import std.stdio, std.string, std.conv;

void main()
{
    while(true)
    {
        int num = readln.chomp.to!int, cnt;
        if(!num)break;
        while(num) cnt += num /= 5;
        cnt.writeln;
    }
}