5. $S$ is the set of rational numbers $r$ where $0<r<1$, and $r$ has a repeating decimal expansion of the form $0 . a b c a b c a b c \cdots$ $=0 . \dot{a} b \dot{c}, a, b, c$ are not necessarily distinct. Among the elements of $S$ that can be written as a fraction in simplest form, how many different numerators are there?
5. Since $0 . \dot{a} b \dot{c}=\frac{a b c}{999}$, and $999=3^{8} \cdot 37$. If $a b c$ is neither divisible by 3 nor by 37, then the fraction is in its simplest form. By the principle of inclusion-exclusion, we have
$$
999-\left(\frac{999}{3}+\frac{999}{37}\right)+\frac{999}{3 \cdot 37}=648
$$

such numbers.
In addition, there are fractions of the form $\frac{k}{37}$, where the natural number $k$ is less than 37 and is a multiple of 3. Such $k$ are $3, 6, 9, \cdots, 36$, a total of 12.
Therefore, the number of fractions that satisfy the condition is $648+12=660$.