N = int(eval(input()))

if N % 2 == 1:

    print((0))

    exit()



ans = 0

mod = 10



while (mod <= N):

    ans += N // mod

    mod *= 5



print(ans)

N = int(eval(input()))



ans = 0



if N % 2 == 0:

    mod = 10

    while N >= mod:

        ans += N // mod

        mod *= 5



print(ans)

N = int(eval(input()))
if N % 2 == 1:
    print((0))
    exit()
ans = 0
mod = 10
while mod <= N:
    ans += N // mod
    mod *= 5
print(ans)

N = int(eval(input()))
ans = 0
if N % 2 == 0:
    mod = 10
    while N >= mod:
        ans += N // mod
        mod *= 5
print(ans)

-if N % 2 == 1: -    print((0)) -    exit() -mod = 10 -while mod <= N: -    ans += N // mod -    mod *= 5 +if N % 2 == 0: +    mod = 10 +    while N >= mod: +        ans += N // mod +        mod *= 5