N = int(eval(input()))



if N%2==1:

    print((0))

    exit()

    

two, five = 0, 0



for i in range(1, 100):

    two += N//2**i



for i in range(1, 100):

    five += N//(2*5**i)



print((min(two, five)))
N = int(eval(input()))



if N%2==1:

    print((0))

    exit()

    

two = 0

p = 1



while 2**p<=N:

    two += N//2**p

    p += 1



five = 0

p = 1



while 2*5**p<=N:

    five += N//(2*5**p)

    p += 1



print((min(two, five)))
N = int(eval(input()))
if N % 2 == 1:
    print((0))
    exit()
two, five = 0, 0
for i in range(1, 100):
    two += N // 2**i
for i in range(1, 100):
    five += N // (2 * 5**i)
print((min(two, five)))

N = int(eval(input()))
if N % 2 == 1:
    print((0))
    exit()
two = 0
p = 1
while 2**p <= N:
    two += N // 2**p
    p += 1
five = 0
p = 1
while 2 * 5**p <= N:
    five += N // (2 * 5**p)
    p += 1
print((min(two, five)))

-two, five = 0, 0 -for i in range(1, 100): -    two += N // 2**i -for i in range(1, 100): -    five += N // (2 * 5**i) +two = 0 +p = 1 +while 2**p <= N: +    two += N // 2**p +    p += 1 +five = 0 +p = 1 +while 2 * 5**p <= N: +    five += N // (2 * 5**p) +    p += 1