#include <stdio.h>

int main(void)
{
	int n;
	int data;
	int ans;
	
	while (1){
		data = 1;
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		ans = 0;
		
		for (int i = 1; i <= n; i++){
			data *= i;
			
			while ((data % 10) == 0){
				ans++;
				data /= 10;
			}
			data %= 100;
		}
		
		printf("%d\n", ans);
	}
	
	return (0);
}