Symmetries of Hamiltonian systems with two degrees of freedom