Problem:
 Score : 500 points    Problem Statement For an integer n not less than 0 , let us define f(n) as follows:   f(n) = 1 (if n < 2 )  f(n) = n f(n-2) (if n \geq 2 )   Given is an integer N . Find the number of trailing zeros in the decimal notation of f(N) .      Constraints  0 \leq N \leq 10^{18}         Input Input is given from Standard Input in the following format:  N       Output Print the number of trailing zeros in the decimal notation of f(N) .        Sample Input 1 12      Sample Output 1 1  f(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080 , which has one trailing zero.       Sample Input 2 5      Sample Output 2 0  f(5) = 5 × 3 × 1 = 15 , which has no trailing zeros.       Sample Input 3 1000000000000000000      Sample Output 3 124999999999999995

Solution (Python):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()

if N % 2 == 1:
    print(0)
    exit()

ans = []
n = N // 10
ans.append(n)

baisuu = 5
while baisuu <= n:
    ans.append(n // baisuu)
    baisuu *= 5

print(sum(ans))

Solution (Python):
N = int(input())
d = 2
count = 0
if N % 2 == 1:
    print(0)
else:
    for i in range(N+1):
        d *= 5
        if d > N:
            break
        count += N//d
    print(count)

Solution (Python):
import math

N = int(input())

memo = [0]*26
for i in range(26):
    memo[i] = 5**(i+1)

if N % 2 == 0:
    ans = 0
    for j in range(26):
        ans += (N//memo[j])//2
    print(ans)
else:
    print(0)

Solution (Python):
n=int(input())
ans=0
cnt=1
i=1
if n%2==1 or n<10:
  ans=0
else:
  while(n>=5**i):
    
    j=5**i
    ans+=(n//j)//2
    i+=1
print(ans)

Solution (Python):
N=int(input())

if N%2!=0:
    print(0)
else:
    
    M=N//2
    ans=0
    while M>=5:
        M=M//5
        ans+=M
    print(ans)

Solution (Python):
N = int(input())

if N%2 == 1:
  print(0)
else:
  ans = N // 10
  for i in range(2, 40):
    x = N // (5 ** i)
    ans += x // 2
  print(ans)

Solution (Python):
def Solve(n):
    k = 10
    ans = 0
    while True:
        t = N // k
        if t == 0:
            break
        ans += t
        k *= 5
    return ans

N = int(input())

if N % 2 == 0:
    print(Solve(N))
else:
    print(0)

Solution (Python):


N = int(input())

if N % 2 == 1:
    print(0)
else:
    h = []
    i = 1
    j = 1
    while i != 0:
        i = N // (5**j * 2)
        h += [i]
        j += 1
    s = 0
    for x in h:
        s += x
    print(s)

Solution (Python):
N = int(input())

if N % 2 != 0:
    print(0)

else:
    result_2 = 0
    n = N
    while n > 0:
        n //= 2
        result_2 += n

    result_5 = 0
    n = N // 2
    while n > 0:
        n //= 5
        result_5 += n
        
    print(min(result_2, result_5))

Solution (Python):
N = int(input())

if N % 2 == 1:
    print(0)
    exit()

while N % 10 != 0:
    N -= 1

answer = 0

x = 1
while N // (5**x) > 1:
    answer += int((N//(5**x)) // 2)
    x += 1

print(answer)

Solution (Python):
n = int(input())

ans = 0
if n % 2 == 1:
  ans = 0
else:
  ans += n // 10
  for i in range(1, 25):
    ans += n // (10 * (5 ** i))

print(ans)

Solution (Python):
n = int(input())
ans = 0

l = 1
while(True):
  if pow(5, l) > n:
    break
  if n%2 == 0:
    ans += n//pow(5, l)//2
  l+=1
print(ans)

Solution (Python):
n = int(input())
m=n
ans=0
for i in range(18):
    ans+=m//10 
    m=m//10
m=n//10   
for i in range(44):
    ans+=m//5
    m=m//5
m=n//10
for i in range(18):
    ans-=m//10 
    m=m//10

if n%2==1: ans=0 
print(int(ans))

Solution (Python):
import sys

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))  
rs = lambda: stdin.readline().rstrip()  

N = ri()

if N&1:
    print(0)
    exit()

answer = N // 10
x = 50
while N >= x:
    answer += (N // x)
    x *= 5
print(answer)

Solution (Python):
n = int(input())
ans = 0
a = 1
na = n
if n % 2 == 1:
    print(0)
else:
    
    
    
    
        
    
    
    


        
        
        
        
        
        

    for j in range(1,40):
        ans += (n // ((5**j)*10))
    n10 = n // 10
    print(ans+n10)

Solution (Python):

def count0(n):
    if n % 2 == 1:
        return 0
    
    rst = n // 10
    tmp = rst // 5
    while tmp > 0:
        rst += tmp
        tmp //= 5

    return rst

n = int(input())
print(count0(n))

Solution (Python):
n = int(input())
if n % 2 == 1:
    print(0)
else:
    i = 10
    ans = 0
    for _ in range(10 ** 18):
        if n < i:
            break
        ans += n // i
        i *= 5
    print(ans)

Solution (Python):

N=int(input())
ans=0
temp=0
temp2=0
if N%2==0:
    ans=N//10
    temp=N//10
    for n in range(1,32):
        temp2=5**n
        ans=ans+temp//temp2
print(int(ans))

Solution (Python):
N = int(input())

def g(n):
  ans = 0
  for i in range(29):
    ans += n//((5**i)*10)
  return(ans)

if N %2 ==0:
  print(g(N))
else:
  print(0)

Solution (Python):
import sys
input = sys.stdin.readline


def main():
    N = int(input())

    if N % 2 == 0:
        ans = 0
        for i in range(1, 30):
            ans += N // (2 * (5 ** i))

        print(ans)
    else:
        print(0)




if __name__ == '__main__':
    main()

Solution (Python):
def f(n):
    if n%2==1:
        return 0
    ans=0
    i=10
    for j in range(n):
        if n>=i:
            ans+=n//i
            i*=5
        else:
            break
    return ans

n=int(input())
print(f(n))

Solution (Python):
n = int(input())

if n % 2 != 0:
  print(0)
else:
  bins = [2 * 5**i for i in range(1, 26)]
  count = 0
  for bin in bins:
    if n < bin:
      break
    else:
      count += n // bin
  print(count)

Solution (Python):
n=int(input())
if n%2!=0:
  print(0)
else:
  a=0
  for i in range(1,26):
    a+=(n//(2*5**i))
  print(a)

Solution (Python):
import sys
n = int(input())

if n % 2 == 0:
    
    k = n//2
    cnt = 0
    d = 5
    while True:
        
        cnt += k // d
        if k // d  == 0:
            break
        d *= 5
        
    print(cnt)
    sys.exit()

else:
    k = n //2  + 1 
    
    
    t1 = 0
    t2 = k
    d = 2
    while True:
        t1 += 2*k // d
        if 2*k //d == 0:
            break
        
        d *= 2
    
    d = 2
    while True:
        t2 += k // d
        if k //d == 0:
            break
        d *= 2
    
    if t1 == t2:
        print(0)
        sys.exit()
    print(t1, t2)

    

    a = 0
    b = 0
    d = 5
    
    while True:
        
        a += k // d
        if k // d  == 0:
            break
        d *= 5

    d = 5
    while True:
        b += 2*k // d
        if 2*k // d == 0:
            break
        d *= 5
    


    print(b-a)

Solution (Python):
n = int(input())
if n % 2 == 1:
    print(0)
else:
    print(sum([n//(10*(5**i)) for i in range(26)]))

Solution (Python):
n = int(input())

if n%2==1:
    print(0)
else:
    count = 0
    n//=2
    for i in range(1,26):
        count += n//(5**i)
        if n//(5**i)==0:
            break
    print(count)

Solution (Python):
'''

sekai_no_owari
 愛

''' 

def findTrailingZeros(n): 
      
    
    count = 0
  
    
    
    
    i=10
    while (n/i>0): 
        count += n//i 
        i *= 5
  
    return int(count) 

n = int(input())
if n%2 != 0:
    print(0)
else:
    print(findTrailingZeros(n))

Solution (Python):


n = int(input())














if n % 2 == 1: ans = 0
else:
    ans = 0
    k = 5
    while 2 * k <= n:
        ans += n // (2 * k)
        k *= 5

print(int(ans))

Solution (Python):
N=int(input())
def fact(N,k):
  t=0
  c=0
  while(k**t<N):
    t=t+1
  for i in range(1,t+1):
    c+=N//(k**i)
  return c
if N%2!=0:
  print(0)
else:
  c2=fact(N//2,2)
  c5=fact(N//2,5)
  print(min(c2,c5))

Solution (Python):
N = int(input())
if N ==1 or N == 0:
    print(0)
else:
    ans = 0
    if N%2 == 1:
        print(0)
    else:
        i = 1
        while True:
            ans += N//(2*(5**i))
            i += 1
            if N//(2*(5**i)) == 0:
                break
        print(ans)

Solution (Python):
import math


def main():
    N = int(input())

    if N == 0 or N == 1:
        ans = 0

    elif N % 2 == 0:
        B = N // 2
        n = math.floor(math.log(B) / math.log(5))

        ans = 0
        for i in range(1, n + 1):
            ans += B // (5**i)

    else:
        ans = 0

    print(int(ans))


main()

Solution (Python):
import sys

answer=124999999999999995

n = int(input())

if n%2==1:
  print(int(0))
  sys.exit()

i=1
j=1
count=0


while 10**i <= n:
  count+= n//(10**i)
  i+=1

while 10*(5**j) <= n:
  count += n//(10*(5**j)) - n//(10**(j+1))
  
  j +=1

print(count)

Solution (Python):
n = int(input())

def calc(n):
  if n % 2 == 1:
    return 0
  now = 10
  ret = 0
  while now <= n:
    ret += (n//now)
    now *= 5
  return ret
print(calc(n))

Solution (Python):
def trail(N):
	if N&1:
		return 0
	cnt=0
	x=1
	while x < N:
		cnt+=(N//(x*10))
		x=5*x
	return cnt
print(trail(int(input())))

Solution (Python):

def solve():
    ans=0
    count=0
    if n%2!=0:
        print(0)
    else:
        ini=0
        while count==0:
            ini+=1
            a=n//(5**ini)
        
            if a==0:
                count=-1
            else:
                ans+=a//2
            
        print(ans)

n=int(input())
solve()

Solution (Python):
N = int(input())

ans = 0

if N % 2 == 1:
    print(0)
else:
    p = 5
    while p < N:
        n = N // p
        ans += n // 2
        p *= 5

    print(ans)

Solution (Python):
n = int(input())
if n%2 ==1:
  print(0)
  exit()

nums = [10**i for i in range(1,19)]

fives = []
for i in range(1,30):
  for j in range(1,19):
    t = 10**j*5**i
    if t <=n:
      fives.append(t)
a = 0
for i in nums:
  a += n//i
  

for i in fives:
  a += (1+n//i)//2
  

print(a)

Solution (Python):
import math
n= int(input())
if n%2==1:
    print(0)
else:
    ans=0
    n//=2
    while n>=1:
        ans+=(n//5)
        n//=5
    print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

def F(N):
    if N & 1:
        return 0
    N //= 2
    x = 0
    while N:
        N //= 5
        x += N
    return x

answer = F(N)
print(answer)

Solution (Python):
n = int(input())
zero = 0

if n%2 == 1:
  zero = 0

i = n//2
if n%2 == 0:
  while i > 0: 
    i = i//5
    zero += i

print(zero)

Solution (Python):
n = int(input())
ans = 0
if n % 2 == 0:
    arr = [10 * (5**i) for i in range(1, 25)]
    ans += n // 10
    for i in arr:
        ans += n // i
print(ans)

Solution (Python):
import collections

N = int(input())

def f(n) :
  if n < 2 :
    return 1
  else :
    return n * f(n-2)

def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0:
        cnt+=1
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a

if N % 2 != 0 :
  print(0)
else :
  
  result = 0
  tmp = N//5
  
  
  
  while True :
    if tmp == 0 :
      break
    result += (tmp//2)
    tmp = tmp//5
  
  
  
  
  
    
    
    
    
    
    
    
    
    
    
    
    
  
  
  print(result)

Solution (Python):

si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
import math
n=ni()

if n==0:
    print(0)
    exit()

if n%2==1:
    print(0)
    exit()

five=math.floor(math.log(n,5))
ans=0


for j in range(five):
    t=n//(5**(five-j))
    ans+=t//2
print(ans)

Solution (Python):





N=int(input())
count=0

for i in range(1,100000):
  if 5**i<=N//2:
    count+=1
  else:
    break





if N%2==1:
  print(0)
else:
  ans=0
  for i in range(1, count+1):
    ans+=N//((5**i)*2)
  print(ans)

Solution (Python):
import sys

N = int(input())

if N % 2 == 1:
  print(0)
  sys.exit()
  

f = lambda x: x * f(x-2) if x>=2 else 1








cnt = 0
cnt += N//10






j = 50
for e in range(1,25):
  cnt += N//(10*(5**e))


print(cnt)

Solution (Python):
n = int(input())

if n % 2 == 1:
    ans = 0
else:
    count = 0
    ans = 0
    
    
    
    for j in range(1, 100):
        five = n // (2 * (5 ** j))
        ans += five

    
print(ans)

Solution (Python):
N = int(input())

if N % 2 == 1:
    print(0)
else:
    R = 10
    ans = 0
    while True:
        c = (N // R)
        ans += (N // R)
        if c == 0:
            break
        R *= 5

    print(ans)

Solution (Python):
N = int(input())
f = 5
ans = 0

if(N % 2 == 1):
    print(0)
else:
    while N >= f:
        ans += int(N // (f * 2))
        f *= 5
    print(ans)

Solution (Python):
N = int(input())
answer = 0
i = 10
if N % 2 == 0:
    while i <= 10 ** 19:
        answer += N // i
        i *= 5
else:
    answer = 0
print(answer)

Solution (Python):
from math import log10

N = int(input())
if N == 0 or N % 2 == 1: print(0)
else:
    temp = [N // ((5**i) * 2) for i in range(1, 2 * int(log10(N)) + 1)]
    ans = sum(temp)
    print(ans)

Solution (Python):
n = int(input())
ans = 0
if n % 2 == 0:
    for i in range(1,26):
        ans += n // (2 * 5**i)
print(ans)

Solution (Python):
n=int(input())  
m=n//2
a=0
if n%2==1:
    a=0
else:
    while m//5>0:
        a=a+m//5
        m=m//5    
    
print("{}".format(a))

Solution (Python):
import sys
n=int(input())
if n%2==1:
  print(0)
  sys.exit()
cnt=0
for i in range(1,28):
  cnt+=n//((5**i)*2)
print(cnt)

Solution (Python):
N = int(input())

if N % 2:
    print(0)
    exit()

b = N // 2
ans = 0
while b:
    tmp = b // 5
    ans += tmp
    b = tmp

print(ans)

Solution (Python):
N = int(input())
ans = 0
if N % 2 == 0:
  n = N // 2
  for i in range(1, 100):
    ans += n // (5 ** i)
print(ans)

Solution (Python):
def main():
    N = int(input())
    MAX = 18
    ans = 0
    if(N % 2 == 1):
        ans = 0
    else:
        tmp = N//10
        ans += tmp
        while(tmp!=0):
            tmp = tmp//5
            ans += tmp
    print(ans)
 

if __name__ == "__main__":
    main()

Solution (Python):

def f0(N):
    if N < 2:
        return 1
    return N * f0(N-2)

def f(N):
    answer = 1
    n = N
    while n >= 2:
        answer *= n
        n -= 2
    return answer

def test(N):
    b = f(N)
    answer = 0
    while b > 0:
        b, r = divmod(b, 10)
        if r == 0:
            answer += 1
        else:
            break
    return answer

def solve(N):
    M = 10**18
    a = 10
    A = []
    while a <= M:
        A.append(a)
        a *= 5
    

    if N % 2 == 1:
        return 0
    answer = 0
    for a in A:
        answer += N//a
    return answer

"""
for i in (98, 100, 110, 120, 148, 150, 200, 248, 250, 296, 298, 300, 400, 900, 950, 1000, 5000, 100000):
    t = test(i)
    print(i, t, solve(i), i//10, i//50, i//250, "rem:%d"%(t-(i//10+i//50+i//250+i//(5**3*10))), sep="\t")
"""
N = int(input())
print(solve(N))

Solution (Python):
def main():
    n = int(input())
    if n%2 != 0:
        print(0)
        return

    if n <= 8:
        print(0)
        return

    ans = 0
    i = 0
    while True:
        x = 10*(5**i)
        if n//x > 0:
            ans += n//x
        else:
            break

        i += 1

    print(ans)

main()

Solution (Python):
N = int(input())

a = []
n = 10
while True:
  a.append(n)
  n *= 5
  if n > 10**18:
    break
num = len(a)
numsum = 0
ans = 0
if N % 2 == 1:
  print(0)
else:
  for i, one in enumerate(reversed(a)):
    sho = N // one
    tmp = sho - numsum
    ans += (num - i) * tmp
    numsum += tmp
  print(ans)

Solution (Python):
N=int(input())
if N%2==1: 
    print(0)
else: 
    ans=0
    i=1
    ans+=N//10
    while N>=10*5**i:
        ans+=N//(10*5**i)
        i+=1
    print(ans)

Solution (Python):
def main():
    N = int(input())
    if N % 2 == 1 or N == 0:
        print(0)
    else:
        base = 2
        d = 0
        while True:
            base *= 5
            x = N // base
            if x == 0:
                break
            else:
                d += x
        print(d)


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
count=0
if n%2==1:
    print(0)
else:
    m=n//10
    count+=m
    for i in range(1,25):
        count+=m//5**i
    print(count)

Solution (Python):
N=int(input())

c=0
if N%2!=0:
    pass
else:
    for i in range(26):
        d=5**(i+1)*2
        c+=N//d

print(c)

Solution (Python):
n = int(input())
if n % 2 == 1:
  print(0)
else:
  n = n//2
  count = 0
  while n > 0:
    count += n//5
    n = n//5
  print(count)

Solution (Python):
from decimal import Decimal, getcontext
getcontext().prec = 32

N = Decimal(int(input()))

if N % 2 == 1:
    print(0)
    exit(0)

ans = Decimal(0)
for i in range(1, 28):
    ans += (N // (Decimal(5) ** Decimal(i))) // Decimal(2)

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    if N % 2 != 0:
        print(0)
        return
    ans = 0
    x = 10
    while x <= N:
        ans += N // x
        x *= 5
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def gcd(a, b):
  if a < b:
      a, b = b, a
  while a % b != 0:
      a, b = b, a % b
  return b


def lcm(a, b):
    y = a*b / gcd(a, b)
    return int(y)

def f(n):
  if n < 2:
    return 1
  elif n >= 2:
    return n * f(n - 2)


n = INT()

















a = 5
a_l = []

if n % 2 == 1:
  print(0)
elif n % 2 == 0: 







  a = 5
  n = n // 2
  while a <= n:
    a_l.append(a)
    a = a * 5
  
  
  ans = 0
  for a in a_l:
    ans += n // a
  
  print(ans)

Solution (Python):
n = int(input())

if n % 2 == 1:
    print(0)
    exit()

if n < 9:
    print(0)
    exit()

need = n // 10

ans = need
tmp = need
start = 1
"""
while tmp != 0:
    ans += tmp // 10
    tmp = tmp // 10
    
"""
tmp = need

while tmp != 0:
    ans += tmp // 5
    tmp = tmp // 5

print(ans)

Solution (Python):
N = int(input())
ans = 0
i = 1
if (N % 2 == 1):
    k = (N + 1) // 2
    while (5**i <= k):
        ans -= k // (5**i)
        i += 1
    i = 1
    while (5**i <= 2*k):
        ans += k // (5**i)
        i += 1
else:
    k = N // 2
    while (5**i <= k):
        ans += k // (5**i)
        i += 1

print(ans)

Solution (Python):
n = int(input())
ans = 0
s = 10
if n % 2 == 0:
    while True:
        x = n // s
        ans += x
        if x != 0:
            s *= 5
        else:
            break
print(ans)

Solution (Python):
import math
n = int(input())
if n % 2 == 1:
  print(0)
  quit()
if n == 0:
  print(0)
  quit()

l = int(math.log10(n))+1
cnt = 0
for i in range(1,10*l):
  cnt += (n // 5 ** i) // 2
print(cnt)

Solution (Python):
n = int(input())
m = n//2
ans = 0
if n%2==1:
    print(0)
else:
    for j in range(1,100):
        ans += m//(5**j)
    print(ans)

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def f(n):
    if n <= 1:
        return 1
    else:
        return n * f(n-2)
    




N = INT()

A = []
i = 0
while 5 ** i <= 10 ** 18:
    A.append(5**i * 10)
    i += 1

if N % 2 == 0:
    ans = 0
    for a in A:
        ans += N // a
    print(ans)
else:
    print(0)

Solution (Python):
n=int(input())

ans = 0
if n % 2 == 1:
    print(0)
else:
    while n // 5 >= 1:
        division_tmp = n // 5
        n = division_tmp
        ans += division_tmp // 2
    print(ans)

Solution (Python):
N = int(input())
if N % 2 != 0:
    print(0)
    exit()
ans = 0
d = 2
while d < N:
    d *= 5
    ans += N // d
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n = ri()
if n % 2 == 1:
    print(0)
    exit()

res = 0
x = 10
while x <= n:
    res += n // x
    x *= 5
print(res)

Solution (Python):
n=int(input())
ans=0
if n%2==1:
  ans=0
else:
  j=n
  for i in range(1,50):
    k=(5**i)*2
    j=(j-j%k)
    ans+=j//k
print(ans)

Solution (Python):
n = int(input().strip())

fn=n//2+1
ans=0
if n%2 == 0: 
    tmp=5
    while tmp<=fn-1:
        ans+=(fn-1)//tmp
        tmp*=5
print(ans)

Solution (Python):
n=int(input())
if n%2==1:
  print(0)
else:
  k=10
  ans=0
  while n>=k:
    ans+=n//k
    k*=5
    
    
  print(ans)

Solution (Python):
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


def main():
    N = int(input())
    if N == 0 or N == 1:
        print(0)
        return

    if N % 2 == 1:
        print(0)
        return
    else:
        N //= 2
        n5 = 0
        i = 1
        while 5**i <= N:
            n5 += N // (5**i)
            i += 1

        print(n5)
        return

    


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
if n%2==1:
    print(0)
else:
    c=0
    i=0
    while True:
        i+=1
        c+=int(n//((5**i)*2))
        
        if int(n//(5**i))==0:
            break
        
    print(c)

Solution (Python):
n = int(input())
if n % 2:
    print(0)
else:
    n = n // 10
    ans = n
    c = 5
    while True:
        if n // c:
            ans += n // c
            c *= 5
        else:
            break
    print(ans)

Solution (Python):
N=int(input())
if N%2==1:
  print(0)
else:
  n=N//2
  A=n
  a=0
  b=0
  while A>=5**a:
    a+=1
  while A>=2**b:
    b+=1

  cntfive=0  
  cnttwo=0
  for i in range(1,a):
    cntfive+=n//(5**i)
  for j in range(1,b):
    cnttwo+=n//(2**j)

  ans=min(cntfive,cnttwo+n)
  print(ans)

Solution (Python):
import sys

n=int(input())

if n%2==1:
    print(0)
    sys.exit()

ans = 0
a=10

for i in range(1000):
    ans += n//a
    a*=5

print(ans)

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()

if n < 10:
    print(0)
    quit()

if n % 2:
    print(0)
    quit()

else:
    ans = n//10
    tmp = 10
    cnt = 0
    while n//tmp > 0:
        tmp = (tmp//2)*10
        ans += (n//tmp)
        cnt += 1
        
    print(ans)

Solution (Python):
n=int(input())
ans=0
if n%2==1:
  print(0)
else:
  for i in range(1,30):
    ans+=n//(5**i*2)
  print(ans)

Solution (Python):
n = int(input())
if n%2==1:
    print(0)
else:
    ans = n//10
    k = 1
    n = n//10
    while 5**k <= n:
        ans += n//(5**k)
        k+=1
    print(ans)

Solution (Python):
n = int(input())
if n % 2 == 1:
    print(0)
    exit()
else:
    ans = 0
    keta = 1
    while n >= (5**keta):
        ans += (n // (5**keta))//2
        keta += 1
    keta = 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
n10 = n
n5 = n//10
ans += n5

if n%2 == 1:
    ans = 0
else:
    for i in range(50):
        n5 = n5 // 5
        ans += n5
        
print(ans)

Solution (Python):
n = int(input())
y = 0
if n % 2 == 0:
    for i in range(1, n):
        k = (5**i) * 2
        if n >= k:
            y += n // k
        else:
            break
    print(y)
else: print(0)

Solution (Python):
N = int(input())
def zero(N):
    if N % 2 == 1:
        return 0
    else:
        return zero2(N)
def zero2(N):
    m = N//2
    n = 0
    i = 1
    while (5 ** i) <= m:
        n = n + (m //(5 ** i))
        i = i + 1
    return n
print(zero(N))

Solution (Python):
n = int(input())
if n % 2 == 1:
    print(0)
else:
    ans = 0
    n //= 2
    frac = 1
    for i in range(1, 26):
        frac *= 5
        ans += n // frac
    print(ans)

Solution (Python):
import math

n = int(input())

if n % 2 == 1:
  print(0)
else:
  ans = 0
  for i in range(1, 100):
    ans += n // (2 * 5 ** i)
  print(ans)

Solution (Python):
n=int(input())

if(n%2 == 1):
    print(0)
else:
    mod=10
    ans=0
    while(n >= mod):
        ans+=n//mod
        mod*=5
    print(ans)

Solution (Python):
N = int(input())

if N % 2 == 0:
    tab = [None] * 32
    pow5 = 10
    for s_tab in range(1, 32):
        if pow5 > N:
            tab[s_tab] = 0
            break
        else:
            tab[s_tab] = N // pow5
            pow5 *= 5
    
    
    ans = 0
    cnt = 0
    for j in range(s_tab):
        i = s_tab - j
        
        cnt_tmp = tab[i] - cnt
        ans += i * cnt_tmp
        cnt += cnt_tmp
    
    print(ans)
else:
    print(0)

Solution (Python):
from decimal import *

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    count=0
    if n%2==1:
        print(0)
    else:
        for i in range(1,30,1):
            b=n//(2*(5**i))
            count+=b
        print(count)
if __name__ == '__main__':
    do()

Solution (Python):
from math import log
n = int(input())
if n % 2 == 1 or n == 0:
    print(0)
else:
    m = n // 2
    total = 0
    for p in range(1, int(log(m, 5)) + 1):
        total += m // (5 ** p)
    print(total)

Solution (Python):
N = int(input())
x = 0
xx = 10
for i in range(1, 10*10, 1):
    x += N//xx
    xx = xx*5
if N % 2:
    print(0)
else:
    print(x)

Solution (Python):
n = int(input())
r = 0
if n %2 == 0:
    while n >= 5:
        r += (n//5)//2
        n //=5
    print(r)
else:
    print(0)

Solution (Python):


N = int(input())

if N % 2 == 1:
    print(0)
else:
    xxx = N // 10
    for i in range(25):
        xxx += (N // (10 * 5 ** (i+1)))
    print(xxx)

Solution (Python):
N = int(input())
A = 0
a = 1
if(N % 2 == 0):
  for i in range(100000):
    a *= 5
    A += N // (a*2)
    if(N//a == 0):
      break
  print(A)
else:
  print(0)

Solution (Python):
n=int(input())
sum=0
if n%2==0:
    a=n
    while a>0:
        a=a//5
        sum+=a//2
print(sum)

Solution (Python):
import sys
n=int(input())
if n%2==1:
    print(0)
else:
    a=n//2
    count=0
    i=1
    while(True):
        b=a//(5**i)
        if b == 0:
            break
        else:
            count+=b
            i+=1
    print(count)

Solution (Python):
N = int(input())

if N % 2 == 1:
    print(0)
    exit()

num = 0
five = 0
N_5 = N // 2

while(True):
    if N_5 >= 5:
        N_5 = N_5 // 5
        five += 1
    else:
        break

N = N // 2

for i in range(1, five+1):
    f = 5 ** i
    num += N // f

print(num)

Solution (Python):
def sarch(n, l):
    a = n * 10 + 5
    b = n * 10
    if l - 1 > 0:
        ans = sarch(a, l - 1)
        ans += sarch(b, l - 1)
    else:
        ans = 0
    
    while n % 5 == 0 and n > 0:
        
        ans += 1
        n //= 5
    
    return ans

n = int(input())
if n % 2 == 0:
    ans = 0
    tmp = 10
    while tmp <= n:
        ans += n // tmp
        tmp *= 5
    print(ans)
else:
    print(0)

Solution (Python):
N = int(input())

if N % 2 != 0:
    print(0)
else:
    ans = N // 10
    k = 50
    while k <= N:
        ans += N // k
        k *= 5
    print(ans)

Solution (Python):
def p_e():
    n = int(input())
    if n & 1 == 1:
        print(0)
        exit()
    ans = n // 10
    x = 50
    while x <= n:
        ans += n // x
        x *= 5
    print(ans)
    
p_e()

Solution (Python):
def main():
    n = int(input())
    if n%2 == 1:
        print(0)
    else:
        ans = 0
        for i in range(1,19):
            ans += n//10**i
        for i in range(1,51):
            ans += n//(10*(5**i)) - n//(10*(5**i)*(2**i))
        print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
ans = 0
xx = 10
if (N % 2 != 1):
  for i in range(1, 10*10):
    ans += N // xx
    xx = xx*5
print(ans)

Solution (Python):
N = int(input())

if N == 0 or N == 1:
    print(0)
    exit()

if N % 2 == 1:
    print(0)
    exit()

answer = 0
cnt = 1
while 5 ** cnt * 2 <= N:
    answer += N // (5 ** cnt * 2)
    cnt += 1

print(answer)

Solution (Python):
N = int(input())
if N%2==1:
    N = 0
else:
    N//=10
c=N

while N//5 !=0:
    N = N//5
    c +=N
    
print(c)

Solution (Python):
n = int(input())
ans = 0
k = 10
if n%2 != 0:
  print(0)
else:
  while k<=n:
    tmp = n//k
    ans += tmp
    k *= 5
  print(ans)

Solution (Python):
N = int(input())
if N % 2 == 1:
  print(0)
  exit()
two = 2
two_cnt = 0
while two <= N:
  two_cnt += (N // two)
  two *= 2
five = 5
five_cnt = 0
while five <= N:
  five_cnt += (N // five) // 2
  five *= 5

print(min(two_cnt,five_cnt))

Solution (Python):
n = int(input())
if n & 1:
    print(0)
else:
    fac = n // 2
    count = 0
    i = 5
    while fac // i >= 1:
        count += fac // i
        i *= 5
    print(count)

Solution (Python):
num = int(input())

if num % 2 == 0:
    divider = [2 * (5 ** x) for x in range(1, 25+1)]
    ans = 0
    for d in divider:
        ans += num // d
    print(ans)

else:
    print(0)

exit(0)

Solution (Python):
n = int(input())

def count5(j):
    if j % 5 != 0:
        return 0
    return count5(j // 5) + 1

if n % 2 == 0:
    i = 2
    v = 1
else:
    print(0)
    exit()

c5 = 0
j = 0

m = n // 2

v5 = 5
while v5 <= m:
    c5 += (m // v5)
    v5 *= 5

print(c5)

Solution (Python):
import math
N = int(input())

k = 0
if N%2 ==0:
  n = N//2
  i = 5
  while n >= i :
    k += n //i
    i *= 5

print(k)

Solution (Python):
n=int(input())
if n%2==1:
    print(0)
else:
    k=n//2
    ans=0
    i=1
    while i<=k:
        i*=5
        ans+=k//i
    print(ans)