How many times is the digit 5 written when listing all numbers from 1 to 100000?

a)4 b)5x10^4 c) 1+10+100+1000

The correct answer is b but I do not understand why.

I thought it is c because 1 to 10 have 1 five, the 11-100 have 1+10 fives.

Thanks for any help that explains the answer of 5x10^4.