import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;

void main()
{
	foreach (line; stdin.byLine) {
		auto n = line.chomp.to!int;
		if (!n) break;
		BigInt factor = 1;
		foreach (i; 1..n+1) {
			factor *= i;
		}
		int cnt;
		foreach_reverse (s; factor.to!string) {
			if (s == '0') cnt++;
			else break;
		}
		cnt.writeln;
	}
}