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$.