#include<stdio.h>
 
int main(){
	unsigned long long int a = 1, count = 0;
	int n, i;
	while(scanf("%d", &n) != 0){
		if(n == 0) break;
		for(i = 1; i <= n; i++) a *= i;
		while(a % 10 == 0){
			if(a % 10 != 0) break;
			count++;
			a /= 10;
		}
		printf("%lld\n", count);
		count = 0;
	}
	return 0;
}