  We address the problem of counting periodic orbits of vector fields on smooth
closed manifolds. The space of non-constant periodic orbits is enlarged to a
complete space by adding the ghost orbits, which are decorations of the zeros
of vector fields. Associated with any compact and open subset $\Gamma$ of the
moduli space of periodic and ghost orbits, we define an integer weight. When
the vector field moves along a path, and $\Gamma$ deforms in a compact and open
family, we show that the weight function stays constant. We also give a number
of examples and computations, which illustrate the applications of our main
theorem.
