5. A natural number is called a "good number" if it is exactly 2007 more than the sum of its digits. Then the sum of all good numbers is $\qquad$ .
5.20145.

Let $f(n)=n-S(n)$ ($S(n)$ is the sum of the digits of the natural number $n$). Then the function $f(n)$ is a non-strictly increasing function, and
$$
\begin{array}{l}
f(2009)<f(2010) \\
=f(2011)=\cdots=f(2019)=2007 \\
<f(2020) .
\end{array}
$$

Therefore, there are only 10 natural numbers that satisfy the condition, and their sum is
$$
2010+2011+\cdots+2019=20145 .
$$