Show that any commutative ring $R$ having only $n$ non-zero zero divisors ($n\geq 1$) is finite and doesn't contains more than $(n+1)^2$ elements.
Let $x$ be a nontrivial zero divisor. Then the annulator $Ann(x)$ is finite: every element of it is either zero or a nontrivial zero divisor itself, so it has at most $n+1$ elements.
Also, it has index at most $n+1$ in $R$: each coset $r + Ann(x)$ corresponds uniquely to the zero divisor $rx$.
So $R$ must have at most $(n+1)^2$ elements.