Find the number of ring homomorphism from $\mathbb Z_2\times \mathbb Z_2$ to $\mathbb Z_4$.
I know that checking idempotent elements the number of ring homomorphisms is $1$. Again the number of ring homomorphism from $\mathbb Z_m$ to $\mathbb Z_n$ is given by $2^{w(n)-w(n/\gcd(m,n))}$ , where $w(n)$ denotes the numbers of prime divisors of positive integer n.
Does there exist a quick way to determine the number of ring homomorphism from $\mathbb Z_a\times \mathbb Z_b$ to another ring $R$ ?
Can anyone suggest me ?