#include<iostream>
using namespace std;
typedef long long ll;
ll n,cnt;
int main(){
  while(cin>>n&&n){
    cnt=0;
    for(ll i=5;i<=2000000000;i*=5){
      cnt+=n/i;
    }
    cout<<cnt<<endl;
  }
  return 0;
}