import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

void main()
{
    for(int n; 0!=(n=readln().chomp().to!int()); )
    {
        auto a=0,b=0;
        foreach(i;1..n+1)
        {
            auto t=i;
            while(t%2==0) t/=2,++a;
            while(t%5==0) t/=5,++b;
        }
        writeln(min(a,b));
    }
}