8. Arrange all positive integers whose sum of digits is 10 in ascending order to form a sequence $\left\{a_{n}\right\}$, if $a_{n}=2017$, then $n=$ $\qquad$
$a_{1}=19, a_{2}=28, \cdots, a_{9}=91, a_{10}=109, a_{11}=118, \cdots$, there are 9 two-digit numbers;
for three-digit numbers, when the first digit is 1, there are 10, when the first digit is 2, there are 9, ..., when the first digit is 9, there are 2, that is, there are $10+9+\cdots+2=54$ three-digit numbers;
for four-digit numbers, when the first digit is 1 and the hundred's place is 0, there are 10, when the hundred's place is 1, there are 9, ..., when the hundred's place is 9, there is 1, at this time, there are $10+9+\cdots+1=55$ four-digit numbers;

for four-digit numbers, when the first digit is 2, there are 2008, 2017. So $n=9+54+55+2=120$.