## Task 1 - 090731

Imagine all natural numbers from 1 to 2555, each written exactly once. Determine the total number of the digit 9 that would need to be written!
I. The digit 9 does not appear in the thousands place of the written numbers.

II. The number of digits 9 that appear in the hundreds place of the written numbers is exactly 100 for the numbers from 1 to 1000; and for the numbers from 1001 to 2000 (2 groups) (since in the first group, the 9 appears in the hundreds place of the numbers 900, ..., 999, and in the second group, exactly in the numbers 1900, ..., 1999). In the numbers from 2001 to 2555, the digit 9 does not appear in the hundreds place.

III. The number of digits 9 that appear in the tens place of the written numbers is exactly 10 for the numbers from 1 to 100; for the numbers from 101 to 200; and so on; for the numbers from 2401 to 2500 (25 groups) (in the first group, exactly in 90, ..., 99, in the second group, exactly in 190, ..., 199, etc.). In the numbers from 2500 to 2555, the digit 9 does not appear in the tens place.

IV. The number of digits 9 in the units place of the numbers is exactly 1 for the numbers from 1 to 10; for the numbers from 11 to 20; and so on; for the numbers from 2541 to 2550 (255 groups). In the numbers from 2551 to 2555, the digit 9 does not appear in the units place.

Therefore, the desired number is $2 \cdot 100 + 25 \cdot 10 + 255 = 705$.