#include <bits/stdc++.h>
using namespace std;
int main(void) {
    int n,count;
    count=0;
    while (cin>>n) {
        if (n==0) {
            break;
        } else {
            for (int i=1;i<=n;i++) {
                int hoge = i;
                while (hoge%5==0) {
                    count++;
                    hoge = hoge/5;
                }
            }
        }
        cout<<count<<endl;
        count=0;
    }
}
