B4. For the second round of the Math Olympiad, 999 students are invited. Melanie prepares invitation letters in the order of participant numbers: $1,2,3, \ldots$ For some values of $n \geqslant 100$, she notices the following: the number of participant numbers from $1$ to $n$ that end in a 5 is exactly equal to the number formed by the last two digits of $n$.

For how many values of $n$ (with $100 \leqslant n<1000$) does this hold?
B4. 9 Let $a, b$ and $c$ be the digits of $n$; that is, $n=100 a+10 b+c$. Then the number of participant numbers from $1 \mathrm{t} / \mathrm{m} n$ that end in 5 is equal to $10 a+b$ if $c<5$ and equal to $10 a+b+1$ if $c \geqslant 5$. The number formed by the last two digits of $n$ is $10 b+c$.

First, consider the case $c<5$. Then $10 a+b$ must be equal to $10 b+c$. Both are two-digit numbers, one with digits $a$ and $b$, the other with digits $b$ and $c$. We find that $a=b=c \neq 0$ and we get the solutions $n=111,222,333,444$.

The case $c \geqslant 5$ is a bit more complicated. The number $10 a+b+1$ must be equal to $10 b+c$. If $b<9$, then the digits of $10 a+b+1$ are exactly $a$ and $b+1$ and we find $a=b$ and $b+1=c$. This gives the solutions $n=445,556,667,778,889$. If $b=9$, then we get $10 a+10=90+c$. From this, it follows that $c=0$ must hold, which contradicts $c \geqslant 5$.

In total, we have found 9 possible values for $n$.