5. The number of 4-digit numbers whose sum of digits equals 12 is. $\qquad$
5. 342. Let the thousands, hundreds, tens, and units digits of a four-digit number be $x_{1}, x_{2}, x_{3}, x_{1}$, respectively, then $x_{1}+x_{2}+x_{3}+x_{1}=12$, $x_{1} \geqslant 1, x_{i} \geqslant 0(i=2,3,4)$, let $y_{1}=x_{1}-1, y_{i}=x_{i}(i=2,3,4)$, then the number of integer solutions to (1) equals the number of non-negative integer solutions to $y_{1}+y_{2}+y_{2}+$ $y_{3}=11$, which is $C_{11+4-1}^{4-1}=C_{14}^{3}=364$. However, solutions where any digit is greater than 9 cannot form a four-digit number. Such solutions $\left(x_{1}, x_{2}, x_{3}, x_{4}\right)$ include the following 22: $(12,0,0,0),(11,1,0,0),(11,0,1,0),(11,0,0,1),(1,11,0,0)$, $(1,0,11,0),(1,0,0,11),(10,2,0,0),(10,0,2,0),(10,0,0,2),(2,10,0,0),(2,0,10,0),(2,0,0$, $10),(10,1,1,0),(10,1,0,1),(10,0,1,1),(1,10,1,0),(1,10,0,1),(1,0,10,1),(1,1,10,0),(1,1$, $0,10),(1,0,10,1)$. Therefore, the number of four-digit numbers is $364-22=342$.