Hi,

I solved the problem [FCTRL][1] . My logic is based on finding the number of 5’s in that like

```
temp=N/d;
while(temp>0){
result=result+temp;
d=d*5;
temp=N/d;
}
Next i checked previous solutions one guy's logic is
z = 0;
while(num >= 5) {
num = (num << 1)/10;
z += num;
}
```

My doubt is how his logic gives write answer even he is calculating 10’s in that number or else can any one please explain his logic mathematically.

Thanks and Regards

Prasad

[1]: http://www.codechef.com/problems/FCTRL