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
from itertools import accumulate, repeat, takewhile
from operator import mul


def main():
    N = int(next(sys.stdin.buffer))
    if N % 2:
        print(0)
        return
    print(sum(N // x for x in takewhile(lambda x: x <= N, accumulate(repeat(5), mul, initial=10))))


if __name__ == '__main__':
    main()

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

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

Solution (Python):
"""
Nが奇数のとき、明らかに掛け算で10の倍数が出来上がらないので、答えは0になる。
Nが偶数のとき、掛け算に巻き込まれる5の素因数の数だけ0ができる。
5^x(1 <= x)ごとに、Nを割る。すると、0~Nに含まれる5^xの数がわかる。
そのうち半分は奇数で半分は偶数である。偶数のカウントだけを加算する。
"""

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

Solution (Python):
n = int(input())
cnt = 0
x = len(str(n))

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

Solution (Python):
n = int(input())
cnt = 0
x = len(str(n))

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


print(cnt)

Solution (Python):
n = int(input())
cnt = 0
x = len(str(n))

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


print(cnt)

Solution (Python):

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


  print(cnt)

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

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

Solution (Python):
import sys
input = sys.stdin.readline
I=lambda:int(input())
MI=lambda:map(int,input().split())
LI=lambda:list(map(int,input().split()))

N=I()

if N%2:
    print(0)
else:
    res=0
    i=1
    while 1:
        dr=N//(2*5**i)
        if dr:
            res+=dr
        else:
            break
        i+=1
    print(res)

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

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

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

Solution (Python):
import sys

N = int(input())

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

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

while  i <= n:
    ans += (n // i)
    i *= 5

print(ans if n & 1 == 0 else 0)

Solution (Python):
N = int(input())
if N & 1:
    print(0)
    exit()
    
N //= 2
cnt = 0
while N:
    cnt += N//5
    N //= 5
print(cnt)

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


if __name__ == '__main__':
    main()

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    
    n = I()
    if n%2 == 0:
        ans = 0
        for i in range(1,27):
            ans += n//(2*pow(5,i))
        print(ans)
    else:
        print(0)

main()

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

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

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

if n % 2 == 1:
	print('0')
		
else:
	five = 0
	two = 0
	for i in range(1, n):
		f = n // (2*(5**i))
		t = n // (2**i)
		if f == t == 0:
			break
		five += f
		two += t
	print(min(five, two))

Solution (Python):
n = int(input())
m = n//10

f = []
while m:
    f.append(m%5)
    m //= 5

print(0 if n%2 else sum(a*(5**(i+1)//4) for i, a in enumerate(f)))

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

if N%2==0:
    ans=0
    x=10
    while x<=N:
        ans+=N//x
        x*=5
else:
    ans=0

print(ans)

Solution (Python):
"""
Nが奇数のとき、絶対に末尾が0が来ることはない。したがって、答えは0。
Nが偶数の時、
N//10 * 1 + N//10**2 * 1 + ...の数だけ0ができる。
"""
N = int(input())
if N % 2 == 1:
    print(0)
else:
    ans = 0
    ind = 1
    while True:
        m = 5**ind
        if m > N:
            break
        r = N//m
        r //= 2
        ans += r
        ind += 1
    print(ans)

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

Solution (Python):
def z(x):
  fives = 0
  for j in range(1, 60):
    bs = 2 * 5 ** j
    fives = fives + x // bs
  return fives
x = int(input())
print(z(x) if x % 2 == 0 else 0)

Solution (Python):
def wtf(x):
  fives = 0
  for j in range(1, 60):
    bs = 2 * 5 ** j
    fives = fives + x // bs
  return fives
x = int(input())
print(wtf(x) if x % 2 == 0 else 0)

Solution (Python):
def wtf(x):
    twos = 0
    fives = 0
    for j in range(1, 60):
        bs = 2 ** j
        twos = twos + x // bs
        bs = 2 * 5 ** j
        fives = fives + x // bs
    return min(twos, fives)
x = int(input())
print(wtf(x) if x % 2 == 0 else 0)

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

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

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

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

Solution (Python):



def solve(N: int):
    if N % 2 == 0:
        N = N // 2
        answer = 0
        div = 5
        while N >= div:
            answer += N // div
            div *= 5
        return answer

    else:
        return 0

    return answer


def main():
    N = int(input())
    answer = solve(N)
    print(answer)


if __name__ == "__main__":
    main()

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

ans=0

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

Solution (Python):
n = int(input())
if n % 2 == 1:
  print(0)
  exit()
ans = 0
ex = 1
while True:
  expo = 2 * 5**ex
  if n // expo == 0:
    break
  ans += n // expo
  ex += 1
print(ans)

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

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

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


ans=0
tmp=0
p=1
if n%2==0:
    k=n//2
    while True:
        tmp =k//pow(5,p)

        ans+=tmp
        p+=1

        if tmp==0:
            break

print(ans)

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

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

fives = [0]

if n % 2 == 1:
    print(0)
else:
    i = 0
    while 1:
        temp5 = (n // (5** (i +1))) //2
        if temp5 != 0:
            fives.append(temp5)
            i += 1
        else:
            break
    print(sum(fives))

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

twoes = [0]
fives = [0]

if n % 2 == 1:
    print(0)
else:
    i = 0
    while 1:
        if n // (2 ** (i +1)) != 0:
            twoes.append(n // (2 ** (i + 1)))
            i += 1
        else:
            break
    i = 0
    while 1:
        temp5 = (n // (5** (i +1))) //2
        if temp5 != 0:
            fives.append(temp5)
            i += 1
        else:
            break
    print(min(sum(twoes), sum(fives)))

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

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

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

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

def solve_function(N):
    if N % 2 == 1:
        return 0

    it_can_be_divisible = 10
    ans = 0
    while True:
        if it_can_be_divisible > N:
            break
        ans += N//it_can_be_divisible
        it_can_be_divisible *= 5

    return ans

if solve_function(N):
    print(solve_function(N))
else:
    print(0)

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

def solve_function(N):
    if N % 2 == 1:
        return 0

    n = 10
    ans = 0
    while True:
        if n > N:
            break
        ans += N//n
        n *= 5
    return ans

if solve_function(N):
    print(solve_function(N))
else:
    print(0)

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

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

n = 10
ans = 0
while True:
    if n > N:
        break
    ans += N//n
    n *= 5

print(ans)

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

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = X_dumy//n
    return out

n=Base_10_to_n(n,5)
n=reversed(list(n))
tmp=1
ans=0

for i in n:
  ans+=int(i)*tmp
  tmp=tmp*5+1
print(ans)

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

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = X_dumy//n
    return out

n=Base_10_to_n(n,5)
n=reversed(list(n))
tmp=1
ans=0

for i in n:
  ans+=int(i)*tmp
  tmp=tmp*5+1
print(ans)

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

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = X_dumy//n
    return out

n=Base_10_to_n(n,5)
n=reversed(list(n))
tmp=1
ans=0

for i in n:
  ans+=int(i)*tmp
  tmp=tmp*5+1
print(ans)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    if N % 2:
        print(0)
        return

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):









def solve(N):
    if N % 2 == 1:
        print(0)
        return
    n = 10
    ans = 0
    while n <= N:
        ans += N // n
        n *= 5
    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)

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

  if N%2:
    print(0)
    return True
  multiplier = 10
  result = 0
  while multiplier <= N:
    result += N // multiplier
    multiplier *= 5

  print(result)

if __name__ == "__main__":
  resolve()

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

Solution (Python):
N=int(input());a=10;b=0
if N&1==0:
    while a<=N:b+=N//a;a*=5
print(b)

Solution (Python):
import math
from typing import List, Counter, Tuple
from collections import Counter
from itertools import permutations, zip_longest, groupby


def read_int() -> int:
    return int(input().strip())


def read_ints() -> List[int]:
    return list(map(int, input().strip().split(' ')))


def solve() -> int:
    
    
    N = read_int()
    if N%2 == 1:
        return 0
    answer = 0
    base = 10
    while base <= N:
        answer += N//base
        base *= 5
    return answer


if __name__ == '__main__':
    print(solve())

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

Solution (Python):
N = int(input())
if N % 2 == 0:
    answer = 0
    N //= 2
    for i in range(100):
        answer += N // 5
        N //= 5
    print(answer)
else:
    print('0')

Solution (Python):
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


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

    ans = 0
    cnt = 10
    while True:
        ans += n//cnt
        cnt *= 5
        if cnt > n:
            break
    print(ans)



if __name__=="__main__":
    main()

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    if N%2==1:
        print(0)
        exit()
    
    ans=0
    
    for i in range(1,100):
        a=2*pow(5,i)
        ans+=N//a
        
    print(ans)
        
    
    

main()

Solution (Python):
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right 
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def perm(n,mod=None):
    ans = 1
    for i in range(1,n+1):
        ans *= i
        if mod!=None:
            ans %= mod
    return ans
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]

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

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

print(ans)

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

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

ketasu = len(str(n))

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

print(ans)

Solution (Python):
import math

N = int(input())

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

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

Solution (Python):
import sys
N = int(input())
if N %2 !=0:
    print(0)
    sys.exit()
else:
    sum = 0
    num = N
    num_tmp = num //5
    while num_tmp > 0:
        num_tmp = num // 5
        sum += num // 10
        num = num_tmp
print(sum)

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

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

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


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


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


def solve(n):
    if n % 2 != 0:
        return 0

    total = 0
    now = 5
    while now <= n:
        total += n // (now * 2)
        now *= 5

    return total


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


if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

print(ans)

Solution (Python):


import sys



N = int(input())









































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

tot = 0
i = 10
while(N >= i):
    tot += N // i
    i *= 5
print(tot)

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

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,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 I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  if n%2==1 or n<10:
    return 0

  st=10
  ans=[]
  while st<=n:
    ans.append(n//st)
    st*=5

  return sum(ans)


print(main())

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

if N % 2 == 0:
    tmp = 10
    ans = 0
    while tmp <= N:
        ans += N // tmp
        tmp = 5 * tmp

    print(ans)
 
else:
    print(0)

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

Solution (Python):





import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
from decimal import *


BUFSIZE = 8192

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

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

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

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

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

de = 10
while de < N + 1:
  res += N // de
  de *= 5
print(res)

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

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

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

print(ans)

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

if N % 2 == 0:
    Ans = 0
    p = 1
    check = 0
    while check != 0 or p == 1:
        check = N // (2 * 5**p)
        Ans += check
        p += 1
    print(Ans)

else:
    print(0)

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

Solution (Python):
import sys
import math

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

count_2 = 0
count_5 = 0
deno = 2
while deno <= N:
    count_2 += N // deno
    deno *= 2

deno = 10
while deno <= N:
    count_5 += N // deno
    deno *= 5

print(min(count_2, count_5))

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

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

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

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

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

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

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

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

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

if N % 2 == 1:
    ans = 0
else:
    div2 = N // 2
    n = N // 2
    k = 1
    while n // 2**k > 0:
        div2 += n // 2**k
        k += 1

    div5 = 0
    n = N // 2
    k = 1
    while n // 5**k > 0:
        div5 += n // 5**k
        k += 1
    
    ans = min(div2, div5)

print(ans)

Solution (Python):
import sys









MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

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

def Main():
    n = read_int()
    if n % 2:
        print(0)
        sys.exit()

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

if __name__ == '__main__':
    Main()

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

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

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

            i+=1
        print(ans)

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

Solution (Python):
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy


import heapq
sys.setrecursionlimit(10**6)

INF = 10**18
import bisect
import statistics
mod = 10**9+7


N = int(input())

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

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

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

Solution (Python):
import math
from decimal import *

def cnt_prime(p, n):
    div = Decimal(str(n))
    s = 0

    while True:
        div /= p
        if div < 1:
            break
        if p == 2:
            s += int(div.quantize(Decimal('0.0'), rounding=ROUND_FLOOR))
        else:
            s += int(div.quantize(Decimal('0.0'), rounding=ROUND_FLOOR)) // 2
    return s

N = int(input())


if N % 2 == 1:
    print(0)
else:
    print(min(cnt_prime(2, N), cnt_prime(5, N)))

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

Solution (Python):



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

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

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

Solution (Python):
n = int(input())
if n%2:print(0);exit()
two = 0
five = 0
val = 2
while val<=n:
    two+=n//val
    val *= 2
val = 5
while val<=n:
    five +=(n//val)//2
    val *=5
print(min(two,five))

Solution (Python):
import sys
sys.setrecursionlimit(2000)

def check_2(num):
    if num % 2 != 0:
        return 0
    return check_2(num // 2) + 1


def check_5(num):
    if num % 5 != 0:
        return 0
    return check_5(num // 5) + 1


def f_2(num):
    if num < 2:
        return 0
    return f_2(num - 2) + check_2(num)


def f_5(num):
    if num < 5:
        return 0
    return f_5(num - 2) + check_5(num)


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

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

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

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

if n % 2 == 0:
    n5 = 1
    y = 10
    c = []

    while y <= n:
        c.append(n//y)
        if len(c) > 1:
            c[-2] -= c[-1]
        y *= 5

    cnt = 0
    for i in range(len(c)):
        cnt += c[i]*(i+1)

    print(cnt)
else:
    print(0)

Solution (Python):
import sys

n = int(input())


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



ans = 0
cnt = 1
while 5**cnt * 2 <= n:
    ans += n // (5**cnt * 2)
    cnt += 1
print(ans)

Solution (Python):

import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def main():
    n = II()
    if n % 2 == 1:
        print(0)
        return

    n_int = n // 2
    ans_int = 0

    k = 5
    while k <= n_int:
        ans_int += n_int//k
        k *= 5

    print(ans_int)


main()

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

Solution (Python):
n=int(input())
if n<=4:
  print(0)
  exit()
  
if n%2==1:
  print(0)
  exit()
  
cnt=10
ans=0

for i in range(100):
  ans+=n//cnt
  cnt*=5
  
  
print(ans)

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

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