5. (7 points) Lёsha did not hesitate to calculate the sum

$$
9+99+999+\ldots+\underbrace{9 \ldots 9}_{2017}
$$

and wrote it on the board. How many times is the digit 1 written in the final result?
Answer: 2013.

Solution. Transform the expression:

$$
\begin{aligned}
9+99+999+\ldots+\underbrace{9 \ldots 9}_{2017} & =(10-1)+(100-1)+\ldots+\left(10^{2017}-1\right)= \\
& =\underbrace{1 \ldots 10}_{2017}-2017=\underbrace{1 \ldots 1}_{2013} 09093 .
\end{aligned}
$$

Criteria. Any correct solution: 7 points.

It is shown that the original sum is equal to $\underbrace{1 \ldots 10}_{2017}-2017$, but further solution is missing or contains an arithmetic error: 5 points. Only the correct answer is provided: 1 point.