$\underline{\text { Kosukhin O.N. }}$

Sasha found that there were exactly $n$ working number buttons left on the calculator. It turned out that any natural number from 1 to 99999999 can either be entered using only the working buttons, or obtained as the sum of two natural numbers, each of which can be entered using only the working buttons. What is the smallest $n$ for which this is possible?
Let's show that the conditions of the problem are met if the buttons with digits 0, 1, 3, $4, 5$ remain functional. Indeed, any digit from 0 to 9 can be represented as the sum of some two "working" digits. Let the number from 1 to 99999999 that we want to obtain consist of digits $a_{1}, a_{2}, \ldots, a_{8}$ (some of them, including the leading ones, may be zeros). Represent each of them as the sum of two "working" digits: $a_{1} = b_{1} + c_{1}, a_{2} = b_{2} + c_{2}, \ldots, a_{8} = b_{8} + c_{8}$. Then the number composed of "working" digits $b_{1}, b_{2}, \ldots, b_{8}$ and the number composed of "working" digits $c_{1}, c_{2}, \ldots, c_{8}$ give the desired number when summed.

Suppose that the desired result can be achieved for some set of four "working" digits. Let $a$ be some odd digit. Among the numbers from 1 to 99999999, there will be one that ends in $a$ and contains "non-working" digits in its decimal representation. Then this number can be represented as the sum of two numbers, whose representations contain only "working" digits. Therefore, for each odd digit $a$, there will be such two "working" digits (possibly the same) whose sum ends in $a$. On the other hand, it is not difficult to see that among all the sums of pairs of four "working" digits, there can be no more than four odd numbers. Therefore, one of the digits $1, 3, 5, 7, 9$ will not appear at the end of such sums. Contradiction.

## Answer

5.