Below is my solution

```
public class Solution
{
public int trailingZeroes(int n)
{
int count = 0;
int val = 5;
for(;n/val>=1;)
{
count += n/(val);
val *= 5;
}
return count;
}
}
```

Above solution is failing for input n = 2147483647

Another solution I found on discussion forum

it is getting accepted. I am unable to get where is solution wrong.Please point it out.

```
public int trailingZeroes(int n) {
int sum = 0;
int count = 1;
while((n/Math.pow(5,count))>=1){
sum = sum + n/(int)Math.pow(5,count);
count = count+1;
}
return sum;
}
```