#include<iostream>
#include<cmath>
#include<climits>
using namespace std;

int main(){
	int num;
	while(1){
		cin>>num;
		if(num==0)break;
		unsigned long long cnt=1;
		int anum=0;
		for(int i=1;i<=num;i++){
			if(i%5==0){
				cnt*=i;
			}else if(i%2==0){
				cnt*=i;
			}
			if(cnt%10==0){
				while(cnt%10==0){
					cnt=cnt/10;
					anum++;
				}
			}
			if(cnt>10000){
				int bug=cnt/10000;
				cnt=cnt-bug*10000;
			}
		}
		cout<<anum<<endl;
	}
	return 0;
}