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:
   print(0)
   exit()

n//=2
ans=0
i=1
while n>=(5**i):
   ans+=n//(5**i)
   i+=1
print(ans)

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


def main():
    n = int(input())
    if n % 2 == 1:
        print(0)
        return
    ans = n // 10
    for i in range(1, 32):
        ans += n // (5**i*10)
    print(ans)

main()

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

Solution (Python):
import math

N = int(input())
if N % 2 == 1:
  print(0)
else:
  zero_count = 0
  if N == 0:
    print(0)
  else:  
    for i in range(1,1+int(math.log(N//2,5)//1)):
      zero_count += (N//2)//(5**i)
    print(int(zero_count))

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

def main():
    n = getN()
    parity = n % 2
    if parity == 1:
        print(0)
        return
    ans = 0

    tmp = 5
    while(tmp <= n):
        rep = n // tmp
        ans += (rep + parity) // 2
        tmp *= 5

    print(ans)

if __name__ == "__main__":
    main()

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

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

cnt=0
num=10
while True:
    cnt+=n//num
    num *= 5
    if num > n:
        break

print(cnt)

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

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

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

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

import sys
ans = 0

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

print(ans)

Solution (Python):





N = int(input())

"""
Nが偶数
f(2) = 2 * f(0) = 2 * 1
f(4) = 4 * f(2) = 4 * 2 * 1
f(6) = 6 * f(4) = 6 * 4 * 2 * 1
となる。
どれも2の倍数なので、2*5**xで割り切れる個数が答え


Nが奇数
f(3) = 3 * f(1) = 3 * 1
f(5) = 5 * 3 * 1
f(7) = 7 * 5 * 3 * 1
なので、偶数が出てくることがないので0
"""

if N in [0,1]:
    print(0)

elif N % 2 == 1:
    print(0)
else:
    ans = 0
    num = 1
    while 5**num <= N:
        cnt = N // (2*5**num)
        ans += cnt
        num += 1

    print(ans)

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

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

Solution (Python):
import sys
stdin = sys.stdin
import copy

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n = ni()
if n % 2 != 0:
    print(0)
else:
    n2 = copy.copy(n)
    n5 = copy.copy(n)
    c2, c5 = 0, 0
    while n2 > 1:
        n2 //= 2
        c2 += n2
    while n5 > 1:
        n5 //= 5
        c5 += n5//2
    print(min(c2, c5))

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

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

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

r = 0
L = int(mt.log(N,5))
for i in range(1,L+1):
    p = N//(5**i)//2
    r += p
    
print(r)

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

Solution (Python):
def trailingZeros(n):
	cnt = 0
	i = 10
	while(n//i >= 1):
		cnt += n//i
		i *= 5
	return cnt

x = int(input())
if x%2 != 0:
	print(0)
else:
	print(trailingZeros(x))

Solution (Python):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n = int(input())

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

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


print(ans)

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

if n%2 == 1:
    print(ans)
else:
    now = 10
    while now <= n:
        ans += n//now
        now *= 5
    print(ans)

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

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


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

exp = 1
zero_count = 0

while 2*(5 ** exp) <= N:
    count = N // (2* (5 ** exp))
    zero_count += count
    exp += 1

print(zero_count)

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

if i % 2 != 0:
  print(0)
else:
  ans = 0
  num = 10
  while num <= i:
    ans += i // num
    num *= 5
  
  print(ans)

Solution (Python):
N = int(input())
 
def solve(N):
    if (N % 2 == 1):
        return 0
    
    d = N // 10
    ans = d
    while d:
        d //= 5
        ans += d
    return ans
 
print(solve(N))

Solution (Python):
import sys
n = int(input())
if n%2 == 1:
    print(0)
    sys.exit()
ans = 0
num = 10
while num<=n:
    ans += n//num
    num *= 5
print(ans)

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

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

if N%2!=0:
  print(0)
else:
  cnt = 0
  n = N//2
  k = 5
  while(n//k != 0):
    cnt += n//k
    k*=5
  print(cnt)

Solution (Python):
def main():
    n = int(input())
    if n%2==1:
        print(0)
        return 
    
    ans = 0
    bunbo = 10
    while bunbo <= n:
        ans += n // bunbo
        bunbo *= 5
    print(ans)
 
 
if __name__ == '__main__':
    main()

Solution (Python):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
if N&1:
    print(0)
    exit()
count = 0
x = 1
while N >= 5**x:
    count += N // (2 * 5**x)
    x += 1

print(count)

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

def main():
    N = int(input())
    if N % 2 == 1:
        print(0)
    else:
        N //= 2
        count = 0
        while N > 1:
            N //= 5
            count += N
        print(count)
    
if __name__ == "__main__":
    main()

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


ans = 0
if n % 2 == 0:
    w = 2
    while True:
        w *= 5
        tmp = n // w
        if tmp == 0:
            break
        ans += tmp

print(ans)

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

Solution (Python):
from itertools import groupby 

N = int(input())

def solve(N):
    if (N % 2 == 1):
        return 0
    
    d = N // 2
    ans = 0
    while d:
        d //= 5
        ans += d
    return ans

print(solve(N))

Solution (Python):
from itertools import groupby 

N = int(input())

def solve(N):
    if (N % 2 == 1):
        return 0
    
    d = N // 10
    ans = d
    while d:
        d //= 5
        ans += d
    return ans

print(solve(N))

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

if N % 2 == 1:
    print(0)
else:
    beki5 = 1
    sum0 = 0
    while 1:
        beki5 = beki5 * 5
        if beki5 > N:
            break
        else:
            sum0 += N//(beki5*2)
    print(sum0)
a = 0

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

if n%2 != 0:
    ans = 0
else:
    ans = 0
    x = 10
    while n >= x:
        ans += n//x
        x *= 5

print(ans)

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

if n%2 != 0:
    ans = 0
else:
    ans = 0
    x = 5
    while n >= x:
        ans += n//(x*2)
        x *= 5

print(ans)

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

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
def m5(N):
    count = 0
    while True :
        k = N // 5
        if k == 0 :
            break
        else :
            N = k
            count += k // 2
    return count
if N % 2 == 1 :
    print(0)
else :
    s = str(N)
    o = int(s[-1])
    N -= o
    print(m5(N))

Solution (Python):
n = int(input())
if n%2 != 0:
  print(0)
else:
  k = 2
  cnt2 = 0
  l = 5
  cnt5 = 0
  while k <= n:
    cnt2 += n//k
    k *= 2
  while n//l != 0:
    cnt5 += (n//l)//2
    l *= 5
  print(min(cnt2,cnt5))

Solution (Python):
n=int(input())
if n%2==1:
    print(0)
    exit()
ans=0
tmp=n
if (n//2)%2==1:
    x=n//2
    tmp-=2
else:
    x=0
tmp//=2
x+=(tmp+1)*tmp//2

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

print(ans)

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

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

    print(ans)

Solution (Python):
x=int(input())
s=0
if x%2==0:
    p=10
    while(p<=x):
        s+=x//p
        p*=5
print(s)

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

if N%2==1:
    print(0)
else:
    k2, k5 = 0, 0
    s = 1
    while 1:
        v = N//(2**s)
        if v==0:
            break
        else:
            k2 += v
        s+=1

    s = 1
    while 1:
        v = N//(5**s)
        if v==0:
            break
        else:
            k5 += (v//2)
        s+=1
    
    print(min(k2, k5))

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

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

Solution (Python):
n = int(input())
nbase = n+0
if n % 2 == 1:
    ans = 0
else:
    ns = 0
    while n != 0:
        n = n//5
        ns += 1

    nsa = ns - 1
    ans = 0
    for i in range(nsa,0,-1):
        o = nbase//(5**i)
        ans += o//2

print(ans)

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

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

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

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

N = int(input())

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

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok


def main():
    N=ii()
    if N&1==1:
        print(0)
        return
    ans = 0
    fi = 10
    while N >= fi:
        ans += N//fi
        fi *= 5
    print(ans)

main()

Solution (Python):
N = int(input())
if N % 2:
    print(0)
    quit()
total = 0
N //= 2
while N:
    N //= 5
    total += N
print(total)

Solution (Python):
N = int(input())
if N % 2 == 0:
    total = 0
    temp = (N // 2) // 5
    total += temp
    while temp:
        temp //= 5
        total += temp
    print(total)
else:
    print(0)

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

if n % 2 == 1:
	print(0)
else:
	m2 = 1
	m5 = 0
	for i in range(1, 101):
		if n // 2 >= 2 ** i:
			m2 += (n // 2) // (2 ** i)
		else:
			break
	for j in range(1, 101):
		if n // 2 >= 5 ** j:
			m5 += (n // 2) // (5 ** j)
		else:
			print(min(m2, m5))
			break

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

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

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

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

print(ans)

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

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

print(ans)

Solution (Python):
import math

N = int(input())
ans = 0

if N % 2 == 1:
    pass
else:
    div = 10
    
    while div <= N:
        ans += N // div
        div *= 5

print(ans)

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

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

cnt = 0
div = 10
while div <= n:
    cnt += n // div
    div *= 5

print(cnt)

Solution (Python):
N = int(input())
if N%2==1:
  print(0)
  exit()
else:
  ans = 0
  for i in range(1,19):
    ans +=N//(10**i)
    l=1
    while N>=10**i*5**l: 
      m=N//(10**i*5**l)
      if m%2==0:
        ans+=m//2
      else:
        ans+=(m+1)//2
      l+=1
print(ans)

Solution (Python):
import re
import numpy as np
n = int(input())

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

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

Solution (Python):
N = int(input())
if N % 2 != 0:
    print(0)
    exit()
cnt = 0
i = 0
while (5 ** i * 10) <= N:
    div = N // (5 ** i * 10)
    cnt += div
    i += 1
print(cnt)

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

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

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
    n = ni()

    if n % 2 != 0:
        print(0)
        return
    
    n //= 10
    ans = n
    while n > 0:
        n //= 5
        ans += n
    print(ans)    

if __name__ == '__main__':
    main()

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

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

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

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

print(ans)

Solution (Python):
def solve(N):
    if N%2==1 or N<=8:
        print(0)
    else:
        ans = 0
        M = N//2
        while M!=0:
            M //= 5
            ans += M
        print(ans)
        
n = int(input())
solve(n)

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

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

Solution (Python):

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

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

print(result)

Solution (Python):
N = int(input())
 
if N % 2 > 0 or N < 10:
  print(0)
  exit()
else:
  
  ans = 0
  N = N // 10
  for i in range(50):
    ans += N
    N = N // 5
    
print(ans)

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

if N % 2 > 0 or N < 10:
  print(0)
  exit(0)
else:
  
  ans = 0
  N = N // 10
  for i in range(50):
    ans += N
    N = N // 5
    
print(ans)

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

Solution (Python):
def solve(string):
    n = int(string)
    if n % 2:
        return "0"
    else:
        ans = 0
        base = 10
        while base <= n:
            ans += n // base
            base *= 5
        return str(ans)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
import numpy as np
n = int(input())
a = len(str(n))
ans = 0


def calc(x, y):
    return x // (10 * 5**y)


if n % 2 == 1:
    pass
else:
    for i in range(a+10):
        ans += calc(n, i)
print(ans)

Solution (Python):



import sys


inp_n = int(input())


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


result = 0
i = 1
while True:
	result += inp_n // ((5 ** i) * 2)
	i += 1
	if inp_n < ((5 ** i) * 2): break


print(result)

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()

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

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

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

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

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

ans = 0

while True:
    ans +=n//10
    n//=5
    if n==0:
        print(ans)
        exit()

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

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

ans = 0
n//=2
while True:
    ans +=n//5
    n//=5
    if n==0:
        print(ans)
        exit()

Solution (Python):
from math import log2
N = int(input())
ans = 0
if(N % 2 == 0 and N != 0):
  for i in range(int(log2(N))):
    ans += (N // 5 ** (i+1)) // 2
  print(ans)
else:
  print(0)

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

print(ans)

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

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

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

if n % 2 == 0:
    cnt = 0
    denom = 10
    while denom <= n:
        cnt += n // denom
        denom *= 5
    print(cnt)
else:
    print(0)

Solution (Python):
def f(n):
    d, z = 10, 0
    while d <= n:
        z += n // d
        d *= 5
    return z

n = int(input())

ans = 0
if n % 2 == 0: 
    ans = f(n)
print(ans)

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


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

n = int(input())

answer = f(n // 2, 5) if n % 2 == 0 else 0
print(answer)

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

Solution (Python):
n = int(input())
result = 0
now = 10

if n % 2 != 0:
  print(0)
else:
  while now < 10**18:
    result += n // now
    now *= 5
    if now > n:
      break
  print(int(result))

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

Solution (Python):
n = int(input())
if n % 2:
    print(0)
else:
    i, k = 0, [1]
    while n > 10*5**i:
        k.append(5*k[i] + 1)
        i += 1  
    ans, r = 0, n
    while i:
        q, r = divmod(r, 10*5**i)
        ans += q*k[i]
        i -= 1
    print(ans + r//10)

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

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

if N % 2 == 0:
    p = 10
    ret = 0

    while p <= N:
        ret += N // p
        p *= 5

    print(ret)
else:
    print(0)

Solution (Python):
N = int(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))

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

if X % 2 != 0 or X < 10:
    print(0)
else:
    X //= 2
    ans = 0
    while X > 0:
        X //= 5
        ans += X
    print(ans)

Solution (Python):
from bisect import bisect_right, bisect_left
from itertools import groupby, permutations, combinations
from fractions import gcd
import numpy as np
from sys import stdin, stderr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def main():
    N = int(input())
    if N % 2 == 1:
        return 0
    d = 10
    m = 1
    ret = 0
    while d <= N:
        ret += m * (N // d)
        d *= 5
    return ret


if __name__ == "__main__":
    print(main())

Solution (Python):

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

ans = N // 10
N //= 10
while N > 0:
    ans += N // 5
    N //= 5
print(ans)

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

Solution (Python):
def solve():
    _N = int(input())
    N = _N
    ans = 0
    if N % 2 == 0:
        div = 10
        while N // div > 0:
            ans += N//div
            div *= 5
    print(ans)


solve()

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

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

n //= 2
ans = 0
while 0 < n:
    ans += n//5
    n //= 5

print(ans)

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

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

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

n //= 2
ans = 0
while 0 < n:
    ans += n//5
    n //= 5

print(ans)

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

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

n5 = 0

if N % 2 == 0:
  for i in range(1,1000):
    t = N // (5**i*2)
    if t > N:
      break
    n5 += t

print(n5)

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

if N % 2 == 1:
  pass
else:
  i = 1
  while 5**i*2 <= N:
    ans += N//(5**i*2)
    i += 1
print(ans)

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

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

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

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

while (n//f)>0:
  i+=n//f
  f=f*5

i+=n//f
print(i)

Solution (Python):
import sys

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

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

	i += 1

print(cnt)

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

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

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

ans = n//10
n //= 10
while n >= 1:
    ans += n//5
    n //= 5

print(ans)

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    if n % 2 == 1:
        return 0
    r = 0
    while n > 0:
        n //= 5
        r += n // 2

    return r


print(main())

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

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

        num_5 = N // 5
        ans += num_5
        N = N // 5

    print(ans)

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

Solution (Python):


import sys
sys.setrecursionlimit(300000)


def solve(N: int):
    if N % 2:
        ret = 0
        print(ret)
        return
    ret = N // 10
    i = 1
    while 10 * (5 ** i) <= N:
        ret += N // (10 * (5 ** i))
        i += 1
    print(ret)
    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):
n = int(input())

if n %2 == 1:
    print(0)
else:
    res = 0
    p = 10
    for _ in range(30):
        res += n//p
        p = p*5
        

    print(res)

Solution (Python):
def count_0(n):
    if n%2 == 1:
        return 0
    div_10 = n//10
    sum = div_10
    for i in range(1, 50):
        sum += div_10//(5**i)
    return sum
N = int(input())
print(count_0(N))

Solution (Python):

n = int(input())


if n%2 == 1 or n < 10:
    print(0)

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

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

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

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

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

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

l = len(str(n))

ans = 0
div = 10
for i in range(1,2*l):
  ans += n//div
  div *= 5
  

print(ans)

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

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

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

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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()








def main():
  n=I()

  if n%2!=0:
    return 0

  a=2
  ans=0
  while True:
    a*=5
    if a>n:
      return ans
    ans+=n//a


print(main())

Solution (Python):

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


if __name__ == "__main__":
    main()

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

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

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


    print(ans)

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
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())
if N%2==1:
    print(0)
else:
    N=N//2
    count=0
    for p in range(1,40):
        count+=N//(5**p)
    print(count)

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

if n%2!=0:
  print(0)
else:
  A=0
  m=10
  while n//m>0:
    A+=n//m
    m*=5
  print(A)

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

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

hoge = []

if N % 2 != 0:
    print(0)
else:
    for i in range(1, 27):
        hoge.append((N // 10)  // (5 ** i))
    print(sum(hoge) + (N // 10))

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

hoge = []

if N % 2 != 0:
    print(0)
else:
    for i in range(1, 40):
        hoge.append((N // 10)  // (5 ** i))
    print(sum(hoge) + (N // 10))