Find the number of times $5$ will be written while listing integers from $1$ to $1000$ Just a question and then, I'll come up with my doubt. It will be easier to explain then.

Question: Find the number of times $5$ will be written while listing integers from $1$ to $1000$.

Now, it can be solved in this fashion. The numbers will be of the form: $5xy, x5y, xy5$ where $x,y$ denote the two other digits such that $0\leq x,y \leq 9$. So, $x,y$ can take $10$ choice each. So, answer is $10^2$ multiplied by $3$ for the $3$ sets of numbers mentioned. Answer becomes $300$ and it's correct.
But the thing is: When we are considering $x5y$, we include $557$ in this. Again, we include $557$ while considering $5xy$, right? 
So that's a double count, yet the answer is right? This way I think there'll be a lot of more-than 1 counts, I'm not sure. 
Please explain me. Regards
 A: From $0$ to $999$ there are $1000$ numbers and they have $10\times 1+90\times 2+900\times 3=2890$ digits
$190$ are zeros and the other $2700$ are divided equally between the other digits, so there are $300$ fives as $300$ nines etc
A: By adding the number of times the digit $5$ occurs in each position, you have counted each number in which $5$ appears exactly two times twice and each number in which $5$ appears exactly three times thrice, once for each position in which it occurs, which is why your method produces the right answer.
Alternate Method:  We want to count the number of times the digit $5$ appears in the list of positive integers from $1$ to $1000$.  Thus, we need to count each integer in which the digit $5$ appears exactly once once, each integer in which the digit $5$ appears exactly two times twice, and each integer in which the digit $5$ appears exactly three times thrice.  
Numbers in which the digit $5$ appears exactly once:  There are three ways to choose the position of the digit $5$.  Since we cannot use $5$ in the remaining positions, there are nine choices for each of the remaining digits.  Hence, there are 
$$\binom{3}{1}9^2$$
such numbers.
Numbers in which the digit $5$ appears exactly twice:  There are $\binom{3}{2}$ ways to choose the positions of the digit $5$.  Since we cannot use $5$ in the remaining position, there are nine choices for the remaining digit.  Hence, there are 
$$\binom{3}{2}9$$
such numbers.
Numbers in which the digit $5$ appears exactly thrice:  There is only one such number, namely $555$.
Total:  The number of times the digit $5$ appears when listing each integer from $1$ to $1000$ is 
$$\binom{3}{1}9^2 + 2\binom{3}{2}9 + 3\binom{3}{3} = 243 + 54 + 3 = 300$$  
