How many solutions do $x^{p-1} \equiv 1 \pmod p$ and $x^{p-1} \equiv 2 \pmod p$ have?

This is my first post so I apologize for any kind of error.

I'm preparing a magistral degree exam in number theory, and I'm performing some exercise. I'm asking here this question: how can I prove how many solutions there are for $$x^{p-1} \equiv 1\pmod p$$ and $$x^{p-1} \equiv 2 \pmod p$$?

Edit: $$p$$ is an odd prime.

• Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be put on hold. To prevent that, please edit the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers. – José Carlos Santos Nov 26 '18 at 9:15
• @Alessar: You may take example for $p$ say $p=5$ to get an intuitive understanding. – Yadati Kiran Nov 26 '18 at 9:32

Consider the multiplicative group $$\Bbb Z^\times_p$$.
• If you know Fermat's Little Theorem, then you would know that, if $p$ is a prime natural number and $x$ is an integer such that $p\nmid x$, then $x^{p-1}\equiv 1\pmod{p}$. Thus, unless $p=2$, $x^{p-1}\equiv 2\pmod{p}$ has no solution. – Batominovski Nov 26 '18 at 9:40