8. On the Green Green Grassland, there live 7 sheep numbered $1,2, \cdots, 7$ and 2017 wolves numbered $1,2, \cdots, 2017$. On this grassland, there are the following strange rules:
(1) Define $P(n)$ as the number of prime numbers less than $n$. Only when $P(i) \equiv j(\bmod 7)$, the wolf numbered $i$ can eat the sheep numbered $j$ (it can also choose not to);
(2) If the wolf numbered $i$ eats the sheep numbered $j$, it will immediately turn into the sheep numbered $j$;
(3) Each wolf, ensuring it will not be eaten, very much wants to experience life as a sheep.

Assuming each wolf is very smart, how many wolves will be left on the grassland in the end?
(Li Wuwei, problem contributor)
8. First, consider the case with 1 sheep and $n$ wolves, where all wolves can eat the sheep.

When $n=1$, the wolf will certainly eat the sheep, without worrying about being eaten after turning into a sheep.

When $n=2$, neither of the two wolves dares to eat the sheep, as they would be eaten by the other wolf after turning into a sheep.

When $n=3$, all three wolves want to eat the sheep because, even if they turn into a sheep, the other two wolves, based on the conclusion for $n=2$, will not dare to eat them.

Assume that when $n=2k$, all wolves do not dare to eat the sheep, and when $n=2k+1$, all wolves want to eat the sheep.

When $n=2k+2$, if a wolf eats the sheep, by the conclusion for $n=2k+1$, it will be immediately eaten by another wolf. Therefore, when $n=2k+2$, all wolves do not dare to eat the sheep.

When $n=2k+3$, if a wolf eats the sheep, by the conclusion for $n=2k+2$, the other wolves will not dare to eat it. Therefore, when $n=2k+3$, all wolves want to eat the sheep.

By mathematical induction, we know that when $n$ is odd, all wolves want to eat the sheep, and when $n$ is even, all wolves do not dare to eat the sheep.
Next, let the set
$$
\begin{array}{l}
S=\{1,2, \cdots, 2017\}, \\
A_{k}=\{n \in S \mid P(n) \equiv k(\bmod 7)\},
\end{array}
$$

where $k=1,2, \cdots, 7$, and let $|A|$ denote the number of elements in set $A$.

From the previous discussion, we only need to consider the parity of $\left|A_{k}\right|$.
Let the prime numbers not exceeding 2017 be
$p_{1}, p_{2}, \cdots, p_{m}=2017$.
Then, for $P(n)=k$ (when $k>1$), $\left|A_{k}\right|$ is even;
when $k=1$, $\left|A_{1}\right|$ is odd.
Therefore, $\left|A_{1}\right|$ is odd, and $\left|A_{k}\right|$ (for $k>1$) is even.
By conclusion (1), we know that in the end, there will be 2016 wolves left on the grassland.