Since
Since the a's are either 0 or 5, when you add them, it's basically a multiple of 5, right? (if there are x a's that are equal to 5, then the sum of the digits will be 5x)
That's how Media_Man got:

i.e.

, where
You can think of it this way, do you know how to tell if a number is divisible by 9? (The sum of the digits should be divisible by 9, we kind of have a modified proof here for a 10 digit number) So, how many 5's should the number have so that when you sum up all the 5's, it should be divisible by 9?
I think the answer is actually 9 ... since 0 isn't a 10 digit number and 0555555555 isn't a 10 digit number either ... I guess it depends though ...
You can also check those 9 numbers by dividing them by 9 ... it's only 9 numbers