#include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    int input;
    while(cin >> input, input){
        int ans = 0, factorial = 1;
        range(i,1,input+1){
            factorial*= i;
            while(true){
                if(factorial % 10 == 0 && factorial >= 10){
                    ans++;
                    factorial /= 10;
                }else{
                    break;
                }
            }
            while(factorial >= 100000){
                factorial-= 100000;
            }
        }
        cout << ans << endl;
    }
}