I'm endless, but I'm also fast. And it can't be wrong!
1 to 10, 2 pieces.
1 1 to 20,9
2 1 to 30,3 1 to 40,41to 50,51to 60,61to 70,71to 80,81.
9 1 to 100, 2 pieces.
So 1 to 100 is 2+9+7+2=20.
10 1 to 200,99
The situation of 20 1 to 300 is similar to that of 1 to 100. The only difference is that 100 is, 300 is not, so it is 19.
The total * * * is 20+99+ 19 = 138.
It took me less than a minute to write a * * * on paper, which should not be too slow for a topic.