  We apply the spectral projector method, recently introduced by Giusti and
L\"uscher, to compute the chiral condensate using $N_f=2$ and $N_f=2+1+1$
dynamical flavors of maximally twisted mass fermions. We present our results
for several quark masses at three different lattice spacings which allows us to
perform the chiral and continuum extrapolations. In addition we report our
analysis on the $O(a)$ improvement of the chiral condensate for twisted mass
fermions. We also study the effect of the dynamical strange and charm quarks by
comparing our results for $N_f=2$ and $N_f=2+1+1$ dynamical flavors.
