That's a lot of variables... what do I do?

Let $$\psi$$ be defined as a function such that for any positive integer $$n$$, $$\psi (n)$$ finds the smallest possible integral value for $$m \geq 2$$ such that $$n^{m} \pmod{10}=n \pmod{10}$$. Let $$P$$ be the probability that if a random nonnegative integer $$n$$ is selected that $$\psi (n)=5$$. If $$P$$ can be written as $$\frac{a}{b}$$ where $$a$$ and $$b$$ are coprime, positive integers, find $$a+b$$.

×