Three periodic solutions for perturbed second order Hamiltonian systems