import math



N = int(eval(input()))

ans = 0



if N % 2 == 1:

    pass

else:

    div = 10

    #for i in range(0, 25):

    while div <= N:

        ans += N // div

        div *= 5



print(ans)
N = int(eval(input()))

ans = 0



if N % 2 == 1:

    pass

else:

    div = 10

    for i in range(0, 25):

    #while div <= N:

        ans += N // div

        div *= 5



print(ans)
import math

N = int(eval(input()))
ans = 0
if N % 2 == 1:
    pass
else:
    div = 10
    # for i in range(0, 25):
    while div <= N:
        ans += N // div
        div *= 5
print(ans)

N = int(eval(input()))
ans = 0
if N % 2 == 1:
    pass
else:
    div = 10
    for i in range(0, 25):
        # while div <= N:
        ans += N // div
        div *= 5
print(ans)

-import math - -    # for i in range(0, 25): -    while div <= N: +    for i in range(0, 25): +        # while div <= N: