  We study N=4 supersymmetric Yang-Mills theory on a Kaehler manifold with
$b_2^+ \geq 3$. Adding suitable perturbations we show that the partition
function of the N=4 theory is the sum of contributions from two branches: (i)
instantons, (ii) a special class of Seiberg-Witten monopoles. We determine the
partition function for the theories with gauge group SU(2) and SO(3), using
S-duality. This leads us to a formula for the Euler characteristic of the
moduli space of instantons.
