```
def trailingZeroes(self, n):
"""
:type n: int
:rtype: int
"""
import math
if n == 0:
return 0
res = 0
x = (int)(math.log(n,5)) # Have 5^x inside
for i in xrange(1,x+1):
res += n/5**i
return (int)(res)
```