My solution that, to my surprise, had such a good performance

```
int trailingZeroes(int n) {
int zeros = 0;
int i = 1;
int curr = 0;
while(1){
curr = (n)/(pow(5,i));
if(curr<1) break;
zeros+=curr;
i++;
}
return zeros;
}
```