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

void main() {
    int n;

    while ((n = readln.chomp.to!int) != 0) {
        int count = 0;
        while ((n /= 5) != 0) {
            count += n;
        }
        writeln(count);
    }
}