```
return n/5 + n/25 + n/125 + n/625 + n/3125;
```

The number of trailing zeros is equal to how many factors of 10 can be found in 'factorial n'.

The prime factors of 10 is 5 and 2.

Also, in any factorial the number of factors of 2 >= number of factors of 5.

Thus, all I need to do is find the number of factors of 5.

My code does this by finding the number of factors divisible by 5 once (n/5) and adding the number of factors divisible by 5 twice (n/25) and so on.

P.S. this code only works for numbers under 15,625 or 5^6--which is out of range of the problem's input.

This is easily fixed by adding n/15625 and n divided by increasing powers of 5.