  We study the Hamiltonian formulation of f(R) theories of gravity both in
metric and in Palatini formalism using their classical equivalence with
Brans-Dicke theories with a non-trivial potential. The Palatini case, which
corresponds to the w=-3/2 Brans-Dicke theory, requires special attention
because of new constraints associated with the scalar field, which is
non-dynamical. We derive, compare, and discuss the constraints and evolution
equations for the ww=-3/2 and w\neq -3/2 cases. Based on the properties of the
constraint and evolution equations, we find that, contrary to certain claims in
the literature, the Cauchy problem for the w=-3/2 case is well-formulated and
there is no reason to believe that it is not well-posed in general.
