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

void main()
{
    while(true)
    {
        long num = readln.chomp.to!long;
        if(!num)break;
        int sum;
        foreach(n; 1 .. num + 1)
        {
            while(n / 5 * 5 == n)
            {
                ++sum;
                n /= 5;
            }
        }
        sum.writeln;
    }
}