No of Homomorphisms

Find the no of ring homomorphisms $f: \mathbb{Z} \to \mathbb{Z}_{30}$
Find the no of ring homomorphisms $f: \mathbb{Z} \to \mathbb{Z}_{30}$
Hint: look at $f(1).$ the number of ring homomorphisms is the number of roots of the equation $x^2=x$ in $\mathbb{Z}/30\mathbb{Z}.$