import std.stdio, std.array, std.conv, std.algorithm, std.string, std.numeric, std.range;
void main() {
	string s;
	while( (s=readln.strip).length != 0 ){
		auto as = s.to!int;
		if(as == 0) break;
		int ans = 0;
		while(0 < as){
			ans += as/5;
			as /= 5;
		}
		writeln(ans);
	}
}