#include<iostream>
#include<sstream>
#include<string>
using namespace std;          
int main(){
  int n,i;

  while(cin >> n){
    int sum = 1,cnt = 0,z = 10;
    if(n == 0)
      break;

    for(i=1; i<=n; i++){
	sum *= i;
    }
    while(sum % z == 0){ 
      cnt++;
      z *= 10;
    }
    cout << cnt  << endl;
  }

  return 0;
}