Gapochkin A.i.

How many integers from 1 to 1997 have a sum of digits that is divisible by 5?
Consider 10 consecutive numbers, starting from a number ending in zero and ending with a number ending in nine. The sums of the digits of these numbers also form 10 consecutive numbers, so among them, exactly two numbers are divisible by 5. The numbers from 0 to 1999 are divided into 200 such tens, therefore, among them, 400 numbers have a sum of digits divisible by 5. It remains to note that among the "extra" numbers 0, 1998, 1999, only one - 0 - has a sum of digits divisible by 5.

## Answer

399.