Three. (25 points) If placing the positive integer $N$ to the left of the positive integer $n$ results in a new number that is divisible by 7, then $N$ is called a "magic number" of $n$. $M$ is a set of positive integers such that for any positive integer $n$, there exists a positive integer in set $M$ that is a magic number of $n$. When $|M|$ is minimized, find the minimum value of the sum of all elements in set $M$.
For $n=1,2, \cdots, 7$.
If $|M| \leqslant 6$, then by the pigeonhole principle, there must be a positive integer $N$ in set $M$ that is a common magic number of $i, j(1 \leqslant i<j \leqslant 7)$, i.e.,
$71(10 N+i), 7 I(10 N+j)$.
Then $7!(j-i)$, but $0<j-i \leqslant 6$, a contradiction.
Therefore, $|M| \geqslant 7$.
Thus, the sum of all elements in set $M$ is no less than
$$
1+2+\cdots+7=28 \text {. }
$$

When $M=\{1,2, \cdots, 7\}$, for any positive integer $n$, let it be a $k\left(k \in \mathbf{N}_{+}\right)$-digit number. Then $10^{k} i+n$ $(i=1,2, \cdots, 7)$ have distinct remainders when divided by 7.

Otherwise, there exist positive integers $i, j(1 \leqslant i<j \leqslant 7)$, such that
$$
\begin{array}{l}
7 \mid\left[\left(10^{k} j+n\right)-\left(10^{k} i+n\right)\right] \\
\Rightarrow 7\left|10^{k}(j-i) \Rightarrow 7\right|(j-i),
\end{array}
$$

a contradiction.
Therefore, there must exist a positive integer $i(1 \leqslant i \leqslant 7)$, such that $71\left(10^{k} i+n\right)$, i.e., $i$ is a magic number of $n$.

Thus, when $|M|$ is minimal, the minimum value of the sum of all elements in set $M$ is 28.