  We prove a closed formula counting semistable twisted (or meromorphic) Higgs
bundles of fixed rank and degree over a smooth projective curve of genus g,
defined over a finite field, when the degree of the twisting line bundle is at
least 2g-2; this includes the case of usual Higgs bundles. We obtain at the
same time a closed expression for the Donaldson-Thomas invariants of the moduli
spaces of twisted Higgs bundles. We similarly deal with twisted quiver bundles
of type A (affine or finite), obtaining in particular a Harder-Narasimhan-type
formula counting semistable U(p,q)-bundles over any smooth projective curve
over a finite field.
