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):
N=int(input())
if(N%2!=0):
    print(0)
    exit()
i=5
cnt=0
while(i<=N):
    cnt+=(N//i)//2
    i*=5
print(cnt)

Solution (Python):
N = int(input())
if N%2 == 1:
  r = 0
  print(r)
  exit(0)
N = N//2
r = 0
for p in range(1025):
  r += N//5
  N = N//5
print(r)

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




if N%2==1 or N<10:
    print(0)
else:
    count=0
    loop=0
    while(1):
        if N<(10*5**loop):
            break
        else:
            count+=N//(10*5**loop)
            loop+=1
    print(count)

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    
    if n%2==1:
        print(0)
    else:
        N=n//2
        cnt=0
        while N>=5:
            cnt+=N//5
            N//=5
        print(int(cnt))
        



    
resolve()

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

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

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

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    if n % 2 != 0:
        print(0)
        exit(0)
    ans = 0
    div = 10
    while n // div:
        ans += n // div
        div *= 5

    print(ans)

Solution (Python):

n = int(input())

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

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

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

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

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

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

n //= 2
res = 0
while n>0:
    res += n//5
    n //= 5

print(res)

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    if n % 2 != 0:
        print(0)
        exit(0)

    ans = 0
    div = 10
    while n // div:
        ans += n // div
        div *= 5
    print(ans)

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

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

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

if n%2==1:
    print(0)
else:
    ans = 0
    memo = []
    bunbo = 10
    while bunbo <= n:
        memo.append(bunbo)
        bunbo *= 5
    for i in memo:
        ans += n//i
    print(ans)

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

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

fifth = [5**k * 2 for k in range(1, 36)]

cnt = 0
for fif in fifth:
	cnt += n // fif
	
print(cnt)

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

ans = 0
i = 1
while 5**i <= N:
    ans += ((N // (2 * 5**i)))
    i+=1

if N % 2:
    print(0)
else:
    print(ans)

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

ans = 0
mul5 = 10
while mul5 <= n:
    ans += n // mul5
    mul5 *= 5
print(ans)

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

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

def g1(n, p):
    if n == 0:
        return 0
    else:
        return n // p + g1(n // p, p)

def g2(n, p):
    res = 0
    if n % 2 == 1:
        return g1(n, p) - g2(n - 1, p)
    else:
        res = g1(n // 2, p)
        if p == 2:
            res += n // 2
        return res


ans = min(g2(n, 2), g2(n, 5))
print(ans)

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

    if N%2!=0:
        print(0)
        exit()
    
    k=10
    ans=0
    while(k<=N):
        ans+=N//k
        k*=5
    print(ans)
    
if __name__=="__main__":
    main()

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

import math

if N % 2 == 1:
    print(0)
elif N == 0:
    print(0)
else:
    half = N // 2
    m = math.floor(math.log(half, 5))
    cnt = 0
    for i in range(m):
        cnt += half // (5 ** (i+1))
    print(cnt)

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    if n % 2 == 1:
        print(0)
    else:
        ans = 0
        div = 10
        while n // div:
            ans += n // div
            div *= 5
        print(ans)

Solution (Python):
from collections import deque
n = int(input())

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

divider = 10
keta_count = []
while True:
    count = n // divider
    divider *= 5
    keta_count.append(count)
    if (count == 0):
        break
print(sum(keta_count))

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

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

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

k=5
ans=0
while k*2<=N:
    ans+=N//(k*2)
    k=k*5

print(ans)

Solution (Python):
import sys
if __name__ == "__main__":
    n = int(input())
    if n % 2 == 1:
        print(0)
        sys.exit(0)

    base = 5

    ans = 0

    while True:
        tmp = n // base
        if tmp == 0:
            break

        ans += tmp // 2
        base *= 5
    print(ans)

Solution (Python):
N = int(input())
ans = 0
keta = 0
if N % 2 == 1:
    print(ans)
else:
    i = 10
    SUM = 0
    for _ in range(100):
        SUM += N // i
        i *= 5
    print(SUM)

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(1000000)

n = int(input())


def calc(n, p):
    if n < p:
        return 0
    else:
        return n//p + calc(n//p, p)


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

'''
ans = 0
n = n // 2
while(n>0):
    ans += n//5
    n = n//5
print(ans)
'''

print(calc(n//2, 5))

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

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

Solution (Python):
N = int(input())
ans = 0
x = 1
if N <= 1 or N % 2 == 1 :print(0)
else:
    while pow(5,x) <= N:
        ans += N // 2 // pow(5,x)
        x += 1
    print(ans)

Solution (Python):


N=int(input())

ans=0
if N%2==0:
    for i in range(18):
        ans+=N//(10*10**i)
    for i in range(100):
        for j in range(100):
            ans+=N//(50*5**i*10**j)-N//(100*5**i*10**j)
    print(ans)
    
    
else:
    print(ans)

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

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

print(ans)

Solution (Python):
N = int(input())
if N % 2:
    print(0)
    exit()
ans = 0
x = 1
while pow(5, x) <= N:
    ans += N // 2 // pow(5, x)
    x += 1
print(ans)

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

if N % 2 == 1 or N < 10:
    print(0)
else:
    cnt = 0
    tmp = 10
    while N // tmp > 0:
        cnt += N // tmp
        tmp *= 5

    print(cnt)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math

    
    

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

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    if n%2==0:
        ans=0
        i=0
        while 10*5**i<=n:
            ans+=n//(10*5**i)
            i+=1
        print(ans)
    else:print(0)

if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    if n%2==0:
        ans=0
        i=0
        while 10*5**i<=n:
            ans+=n//(10*5**i)
            i+=1
        print(ans)
    else:print(0)

if __name__=='__main__':
    main()

Solution (Python):
N = int(input())
i = 5
ans = 0
if N %2 == 0:
    for j in range(10**8):
        num = N//(i*2)
        if num == 0:
            break
        else:
            ans += num
            i = i*5

print(ans)

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

Solution (Python):


n = int(input())

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

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

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

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

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

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

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

ans = 0
num = 10
while num <= n:
    ans += n // num
    num *= 5

print(ans)

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

Solution (Python):
N = int(input())
count = 0
i = 1
j = 10
if N % 2 == 0:
    while j <= N:
        count += N // j
        j *= 5
        i += 1
    print(count)
else:
    print('0')

Solution (Python):
n = int(input())
if n % 2 == 1:
    print(0)
    exit()
elif n % 2 == 0:
    ans = n//10
    kar = n//10
    while True:
        if kar // 5 >= 1:
            ans += kar // 5
            kar = kar// 5
        elif kar // 5 < 1:
            break
print(ans)

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

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

Solution (Python):
import math

N = int(input())

if N % 2 != 0:
  print(0)
else:
  answer = 0
  i = 0
  j = 1
  while j > 0:
    a = math.floor(N // (10 * (5 ** i)))
    if a == 0:
      print(answer)
      break
    else:
      answer += a
      i += 1

Solution (Python):
N = int(input())
if N % 2 != 0:
    print(0)
    exit()

k = 10
ans = 0

while(N >= k):
    ans += N//k
    k *= 5

print(ans)

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

ans = 0
i = 0
while True:
    if n%2 == 1:
        break
    i += 1
    ans += n//2//(5**i)
    if n//2//(5**i) == 0:
        break

print(ans)

Solution (Python):
n = int(input())
c, s = 10, 0
if n%2:
  print(0)
else:
  while True:
    if n<c:
      print(s)
      exit()
    s += n//c
    c *= 5

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

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

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

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

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

ans = 0
d = 10
while d <= n:
    ans += n // d
    d *= 5
print(ans)

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

Solution (Python):

import math
import operator as op
from functools import reduce
from fractions import Fraction as frac




def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
    

def rd(p):
    if(p==0):
        return input()
    if(p==1):
        return int(input())
    if(p==2):
        return map(int,input().split())
    if(p==3):
        return list(map(int,input().split()))



global par
par=[-1 for i in range(100001)]

def find(u):
    if(par[u]<0):
        return u
    else:
        return find(par[u])
def uni(x,y):
    u=find(x)
    v=find(y)
    if u==v:
        return
    if(par[u]<par[v]):
        par[u]+=par[v]
        par[v]=u
    else:    
        par[v]+=par[u]
        par[u]=v

        

t=1
for term in range(1,t+1):
    n=rd(1)
    div=10
    tot=0
    if n%2==1:
        print(0)
    else:    
        while(n>=div):
            
            tot+=(n//div)
            div*=5
        print(tot)

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

















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

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

ans = 0
if n%2 == 0:
    pre = 0
    for i in range(32,0,-1):
        ct = n//(5**i*2)
        ans += i*(ct-pre)
        pre = ct

print(ans)

Solution (Python):

import sys
import math


def solve(N: int):
    if N %2 ==1:
        print(0)
        exit()
    else:
        sum = 0
        digit = 1
        while 5**digit*2 <= N:
            sum += N//(5**digit*2)
            digit+=1
        print(sum)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)


if __name__ == '__main__':
    main()

Solution (Python):
import math  
import bisect  
import queue  


if __name__ == '__main__':
    N = int(input())
    if N % 2 == 0:
        ans = N // 10
        d = 50
        while N // d > 0:
            ans += N // d
            d *= 5
        print(ans)
    else:
        print(0)

Solution (Python):
N = int(input())
n = N // 10
lista = []

while n != 0:
    lista.append(n)
    n //= 5
print(sum(lista) if N % 2 == 0 else 0)

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

a = n
cnt = 0
i = 1
while True:
    if a >= 2*5**i:
        cnt += a//(2*5**i)
        i += 1
    else:
        break
print(cnt)

Solution (Python):
n=int(input())
if n%2!=0:
    print(0)
else:
    f=[]
    five=10
    for i in range(27):
        x=n//five
        f.append(x)
        five*=5
    f2=[]
    for i in range(26):
        f2.append(f[i]-f[i+1])
    ans=0
    for i in range(26):
        ans+=(i+1)*f2[i]
    print(ans)

Solution (Python):

import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7


    def countZero(n):
        return len(str(n))-len(str(n).rstrip('0'))
    
    def f(n):
        if n < 2:
            return 1
        else:
            n2 = f(n-2)
            if n % 10 != 0 and countZero(n2) != countZero(n2*n):
                print(n,n2)
            return n * n2
    N = II()
    
    
    
    if N % 2 == 1:
        print(0)
        return
    else:
        ans = 0
        b = 10
        while (N-b)//b +1 > 0:
            ans += (N-b)//b +1
            b *= 5
        print(ans)
        
        
        
        
        return
if __name__ == '__main__':
    main()

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

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

    zero_count = 0

    i = 10
    while n // i != 0:
        zero_count += n // i
        i *= 5

    print(zero_count)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
N = int(input())
if N%2==1:
    print(0)
else:
    num = 1
    while N>=5**num:
        num += 1
    num -= 1
    answer = 0
    for i in range(1,num+1):
        answer += N//(2*5**i)
    print(answer)

Solution (Python):
N = int(input())
if N % 2 == 1:
    print(0)
    quit()
N //= 2
res = 0
i = 0
while (5 ** i) <= N:
    
    i += 1
    res += N // (5 ** i)
print(res)

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

ret = 0
waru = 10

if n % 2 == 1:
    print(0)
    exit()
else:
    while n >= waru:
        ret += n // waru
        waru *= 5

print(ret)

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

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


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

    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)


if __name__ == "__main__":
    main()

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


def main():
    N = int(input())
    if N < 2:
        print(0)
        return
    if N % 2 == 1:
        print(0)
        return
    n = 2
    cnt = 0
    while n * 5 <= N:
        n *= 5
        cnt += 1
    ans = 0
    for _ in range(cnt):
        ans += N // n
        n //= 5
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
if n % 2 != 0:
    print(0)
else:
    n //= 2
    div = 5
    cnt = 0
    while n//div != 0:
        cnt += (n//div)
        div *= 5
    print(cnt)

Solution (Python):


import sys
import math

















def main():
    mod = 1000000007                  
    inf = float('inf')
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    e = ii()
    if e == 0 or e % 2 == 1:
        print(0)
    else:
        ans = e // 10
        d = 50
        while d <= e:
            ans += e // d
            d *= 5
        print(ans)

if __name__ == "__main__":
    main()

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

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


if __name__ == "__main__":
    main()

Solution (Python):
import math
import fractions
import sys

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))



def funct(n):
	i=1
	res=0
	while True:
		ans=2*5**i
		
		if n//ans==0:
			break
		res+=(n//ans)
		i+=1
	return res


N=input1()
a=0
if N%2==1:
	a=0
else:
	a=funct(N)

print(a)

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

Solution (Python):
n = int(input())
total = 0
i = 1

while(n//pow(5, i)):
    if n%2 == 0:
        total += (n // pow(5, i)) // 2
    i += 1

print(total)

Solution (Python):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    n = II()
    cnt = 0
    val = 10
    if n%2==1: print(cnt); exit(0)
    while True:
        if n < val: break
        cnt += n//val
        val *= 5
    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

input = sys.stdin.readline

P = 998244353


def main():
    N = int(input())
    if N % 2 == 1:
        print(0)
    else:
        ans = 0
        tmp = 10
        while True:
            if tmp > N:
                break
            ans += N // tmp
            tmp *= 5
        print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import math

def main():
    ans = 0
    den = 10
    N = int(input())
    while(N >= den):
        ans += N // den
        den *= 5
    if N % 2 == 0:
        print(ans)
    else:
        print(0)

main()

Solution (Python):
n = int(input())
UPPER = 10**18

def solve(n):
    if n%2 == 1:
        return 0
    res = 0
    fiv = 2*5
    while fiv <= n:
        res += n // fiv
        fiv *= 5
    return res

print(solve(n))

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

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

Solution (Python):
N = int(input())
if N % 2 == 1:
  print(0)
  exit()
else:
  N //= 2
  ans, i = 0, 1
  while N // pow(5, i) != 0:
    ans += N // pow(5, i)
    i += 1
print(ans)

Solution (Python):


N = int(input())

ans = 0
p = 10

if (N%2==0):
    while True:
        if p > N:
            break
        ans += N // p
        p *= 5

print(ans)

Solution (Python):
import sys
import math

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

p = n / 2

x = int(math.log(p, 5))


count = 0
""" for i in range(1,x+1):
    count += int(p/(5**i))
    
print(count) """
i = 1
while i * 10 <= n:
    
    count += n // (i*10)
    
    i *= 5
print(count)

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

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

N = N // 2

while (N >= 5):
    N = N // 5
    ans += N

print(ans)

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

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

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

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

print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
n = int(readline())
if n % 2 == 1:
    print(0)
else:
    n //= 2
    answ = 0
    while n:
        n //= 5
        answ += n
    print(answ)

Solution (Python):
import sys
import math
import numpy
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
p = int(readline())
if p % 2 == 1:
    print(0)
else:
    p //= 2
    ans = 0
    while p:
        p //= 5
        ans += p
    print(ans)

Solution (Python):
def findTrailingZeros(n): 
      
    if (n%2!=0): 
        return 0

    else: 
        ans = 0
        n //= 2
        while (n): 
            ans += n // 5
            n //= 5
  
        return ans 
  
n = int(input())
  
print(findTrailingZeros(n))

Solution (Python):
def findTrailingZeros(n): 
    if (n & 1): 
        return 0
    else: 
        ans = 0
        n //= 2
        while (n): 
            ans += n // 5
            n //= 5
        return ans 

  
n = int(input())
  
print(findTrailingZeros(n))

Solution (Python):
import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
p = int(readline())
if p % 2 == 1:
    print(0)
else:
    p //= 2
    ans = 0
    while p:
        p //= 5
        ans += p
    print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
l= int(readline())
if l% 2 == 1:
    print(0)
else:
    l //= 2
    ans = 0
    while l:
        l //= 5
        ans += l
    print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
nu = int(readline())
if nu % 2 == 1:
    print(0)
else:
    nu //= 2
    answ = 0
    while nu:
        nu //= 5
        answ += nu
    print(answ)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
n1 = int(readline())
if n1 % 2 == 1:
    print(0)
else:
    n1 //= 2
    ans = 0
    while n1:
        n1 //= 5
        ans += n1
    print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
p = int(readline())
if p % 2 == 1:
    print(0)
else:
    p //= 2
    ans = 0
    while p:
        p //= 5
        ans += p
    print(ans)

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

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

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

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

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

Solution (Python):
N = int(input())
if N%2 == 1:
  print(0)
else:
  N = N//10
  num = N
  while N !=0:
    N = N//5
    num += N
  print(num)

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

def ans(n):
    if n % 2 != 0:
        return 0
    else:
        index,count = 1,0
        while 2 * 5**index <= n:
            count += n // (2 * 5**index)
            index += 1
    return count

print(ans(N))

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

Solution (Python):
L = [10, 50, 250, 1250, 6250, 31250, 156250, 781250, 3906250, 19531250, 97656250, \
     488281250, 2441406250, 12207031250, 61035156250, 305175781250, 1525878906250, \
     7629394531250, 38146972656250, 190734863281250, 953674316406250, \
     4768371582031250, 23841857910156250, 119209289550781250, 596046447753906250]
N = int(input())
A = 0
if N % 2 == 0:
  for i in L:
    A += N // i
print(A)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

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

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

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

else:
  counter2 = 0
  counter5 = 0
  
  stock = n
  stock = stock//2
  
  while stock > 0:
    stock = stock//5
    counter5 += stock
    
  stock = n//2
  counter2 += stock
  while stock > 0:
    stock = stock//2
    counter2 += stock
    
  print(min(counter2, counter5))

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


if N % 2 != 0:
  print(0)
else:  
  counter = [0] * 25
  for i in range(25):
    counter[i] = N // (2 * 5 ** (i + 1))
  for i in range(24, -1, -1):
    counter[i] = counter[i] - sum(counter[i + 1:])
    
  total = 0
  for i in range(25):
    total += ((i + 1) * counter[i])
                                  
  print(total)

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

def div_5(n):
    cnt = 0
    mod = 5 * 2
    while mod <= n:
        cnt += n // (mod)
        mod = mod * 5
    return cnt

if n % 2 == 1:
    print(0)
else:
    print(div_5(n))

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

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

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

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

num = 2*5
ans = 0

while n>=num:
    ans += n//num
    num *= 5

print(ans)