On the periodic orbits of Hamiltonian systems