#include<iostream>
#include<math.h>
long long int kaijo(long long int n);
using namespace std;
int main(){
  int n;
  long long int ans;
  int count=0;
  int keta;
  while(1){
    count=0;
    cin>>n;
    if(n==0) break;
    ans=kaijo(n);
    while(10<=ans){
      if(ans%10==0){
	count++;
      }
      else{
	break;
      }
      
      ans=ans/10;
    }
    
    cout<<count<<endl;
  }
}
long long int kaijo(long long int n){
  long long int m;
  if(n==0) return 1;
  m=kaijo(n-1);
  return n*m;
}
 