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
input = sys.stdin.readline

n, x, res = int(input()), 1, 0
if n & 1: print(0)
else:
    n //= 2
    while x < n:
        x *= 5
        res += n // x
    print(res)

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

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

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

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

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

ans = 0
a = 10
while True:
    if N < a:
        break

    ans += N//a
    a *= 5
print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

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

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    if N%2:
        print(0)
    else:
        m = N//2
        ans = 0
        t = 5
        while m >= t:
            ans += m//t
            t *= 5
        print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
if n%2==1:
    ans = 0
else:
    tmp = 2
    v2 = 0
    while n//tmp>0:
        v2 += n//tmp
        tmp *= 2
    v5 = 0
    tmp = 5
    nn = n//2
    while nn//tmp>0:
        v5 += nn//tmp
        tmp *= 5
    ans = min(v2, v5)
print(ans)

Solution (Python):
import math
n = int(input())
if n%2==1:
    print(0)
else:
    print(sum([n//(2*pow(5,i)) for i in range(1,math.ceil(math.log(n+1,5)))]))

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

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

"""
2,5が大事
11 > 9 > 7 > 5 > 3 > 1

10 > 8 > 6 > 4 > 2 > 1
10の個数

というより5の倍数をどう数えるかが重要．
まず10でぜんたいを割って10による部分をansにたす．
その後，5の倍数を取り出す．
"""
if N % 2 == 1:
    print("0")
    sys.exit()













ans = 0
if N >= 10:
    N //= 10
    ans += N

n = copy.deepcopy(N)
while n > 4:
    n //= 5
    ans += n

print(ans)

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

if N % 2 == 1:
    print(0)
else:
    cnt = 0
    div = 10
    for _ in range(100):
        cnt += N // div
        div *= 5
    print(cnt)

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

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

"""
2,5が大事
11 > 9 > 7 > 5 > 3 > 1

10 > 8 > 6 > 4 > 2 > 1
10の個数
"""
if N % 2 == 1:
    print("0")
    sys.exit()













ans = 0
if N >= 10:
    N //= 10
    ans += N

n = copy.deepcopy(N)
while n > 4:
    n //= 5
    ans += n

















print(ans)

Solution (Python):

N = int(input())




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

bunbo = 0
sum_5 = 0
while (10 * 5 ** bunbo) <= N:
    sum_5 += N // (10 * 5**bunbo)
    bunbo += 1

print(sum_5)

Solution (Python):
import sys

N = int(input())
temp = 5
ans = 0
if N%2:
    print(0)
    quit()
else:
    N = N//2
    while temp <= N:
        ans += N//temp
        temp *= 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):
def calculate(n):
    if n % 2 == 1:
        return 0

    s1 = n // 10

    index = 1

    s2 = 0
    while (5 ** index) <= s1:
        s2 += (s1 // (5 ** index))
        index += 1

    return s1 + s2
print(calculate(int(input())))

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

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

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

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

print(ans)

Solution (Python):
N = input()

def f(x):
  p = 1
  i = 1
  cnt = 0
  while p > 0:
    p = x // (5**i) // 2
    cnt += p
    i += 1
  return cnt

if int(N[-1])%2 == 1:
  print(0)
else:
  print(f(int(N)))

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

Solution (Python):
import sys
read = sys.stdin.read
def main():
    n = int(input())
    if n <= 9 or n % 2 == 1:
        print(0)
        sys.exit()

    n5 = 5
    r = 0
    while n >= n5 * 2:
        r += n // (n5 * 2)
        n5 *= 5
    print(r)

if __name__ == '__main__':
    main()

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

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

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

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

else:
    fives = 0
    power = 0

    while (5 ** (power+1)) <= N:  
        power += 1

    for i in range(1, power+1):
        fives += N // (5 ** i) // 2

    print(int(fives))

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

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

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

    N //= 10
    ans = N
    while N:
        N //= 5
        ans += N

    print(ans)
    return


if __name__ == '__main__':
    main()

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 = N // 10
    p = 50
    while True:
        tmp = N // p
        if tmp == 0:
            break
        ans += tmp
        p *= 5

    print(ans)
    return


if __name__ == '__main__':
    main()

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

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

Solution (Python):
def readinput():
    n=int(input())
    return n

def main(n):
    if n%2==1:
        return 0
    
    n=n//2
    count=0
    base=5
    while(base<=n):
        count+=n//base
        base*=5
    return count

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

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

Solution (Python):
def resolve():
    '''
    code here
    '''
    N = input()

    res = 0
    if int(str(N)[-1]) % 2 == 0:
        i = 0
        N=int(N)
        while int(N) >= 2*5**i:
            i += 1
            res += N//(2*5**i)

    print(res)



if __name__ == "__main__":
    resolve()

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

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

cnt=0
n//=2
fact=1
while n>=5**fact:
    cnt+=n//(5**fact)
    fact+=1
print(cnt)

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

ans = 0
if n >= 2 and n % 2 == 0:
    j = 10
    while n >= j:
        ans += (n // j)
        j *= 5

print(ans)

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

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

ans=N//10
cur=N//10
while cur//5>0:
    cur//=5
    ans+=cur


print(ans)

Solution (Python):







        




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

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

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

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

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

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

print(res)

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

n = int(input())

import math

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

k = 0
while n - 2*5**k >= 0:
    k += 1
k -= 1

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

print(ans)

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


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

Solution (Python):
N = int(input())
if N%2==1:
    print(0)
else:
    ans = 0
    l = []
    N//=2
    n = len(str(N))
    while True:
        a = N//5
        ans += a
        N = a
        if a==0:
            break
    print(ans)

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

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

tmp = 2 * 5
while N >= tmp:
    ans += N // tmp
    tmp *= 5
print(ans)

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

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
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 ** 9)
mod = 10**9+7

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

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

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

if N%2==1:
    print(0)
else:
    counter = 0
    tmp = 1
    while True:
        tmp *= 5
        
        if tmp>N:
            print(counter)
            break
        counter += N//(tmp*2)

Solution (Python):
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N = int(readline())
    if N % 2 == 1:
        print(0)
    else:
        count2 = 0
        count5 = 0
        compare = 1
        while N >= compare * 2:
            compare *= 2
            count2 += N // compare
        compare = 1
        N //= 2
        while N >= compare * 5:
            compare *= 5
            count5 += N // compare
        ans = min(count2, count5)
        print(ans)



if __name__ == '__main__':
    solve()

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True

    @staticmethod
    def fact(N):
        res = {}
        tmp = N
        for i in range(2, int(N ** 0.5 + 1) + 1):
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            if cnt > 0:
                res[i] = cnt
        if tmp != 1:
            res[tmp] = 1
        if res == {}:
            res[N] = 1
        return res


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    N = Scanner.int()
    if N % 2 == 1:
        print(0)
        return
    ans = 0
    while N > 0:
        ans += N // 10
        N //= 5
    print(ans)


def main():
    
    
    
    
    
    solve()


if __name__ == "__main__":
    main()

Solution (Python):

n = int(input())
ans = 0
if n%2 == 0:
    m = 1
    for _ in range(25):
        ans += n//(m*10)
        m *= 5
print(ans)

Solution (Python):
N = int(input())
if N % 2:
    print(0)
    exit()
ans = 0
tmp = 10
while N >= tmp:
    ans += N//tmp
    tmp *= 10
tmp = 50
tmp_2 = 100
while N >= tmp:
    ans += N//tmp - N//tmp_2
    tmp *= 5
    tmp_2 *= 10
print(ans)
ans = 0

Solution (Python):
from math import log10

n = int(input())

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

n -= n % 10
s = n // 10
t = s

while t != 0:
    s += t // 5
    t //= 5

print(s)

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

k=n//2

from math import floor

ans=0
deno=5
while deno<=k:
    ans+=k//deno
    deno*=5

print(ans)

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

n//=2
from math import floor,factorial

ans=0
deno=5
while deno<=n:
    ans+=n//deno
    deno*=5

print(ans)

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

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


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

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


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


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



n = int(input())

def func(n):
    if n % 2 == 1:
        return 0
    ans1 = 0
    ans2 = 0
    d1 = 1
    d2 = 1
    while 2 ** d1 * 2 <= n:
        ans1 += n // 2 ** d1
        d1 += 1
    while 5 ** d2 * 2 <= n:
        ans2 += n // (5 ** d2 * 2)
        d2 += 1
    ans = min(ans1, ans2)
    return ans

def func2(n):
    if n % 2 == 1:
        return 0
    x = 1
    for i in range(2, n + 2, 2):
        x *= i
    x = str(x)[::-1]
    ret = 0
    for j in x:
        if j != "0":
            return ret
        ret += 1
    return ret

ans = func(n)
print(ans)

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

if N % 2 != 0:
    print('0')
else:
    count = 0
    i = 1

    while True:
        dif = (N // 2) // (5 ** i)
        count += dif
        if dif == 0:
            break

        i += 1

    print(count)

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

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

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

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

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

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


print(count)

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

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

cnt = 0
for i in range(1,26):
  x = pow(5,i)
  x *= 2
  if x > n:
    continue
  cnt += n//x
print (cnt)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7

def resolve():
    n = int(input())
    if n % 2 != 0:
        print(0)
        exit()
    L = n // 2
    res = 0
    while L:
        res += L // 5
        L //= 5
    print(res)

if __name__ == '__main__':
    resolve()

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

ans = 0
if N % 2 == 0:
  ans += N//10
  ans += N//50
  N //= 50
  while N > 0:
    N //= 5
    ans += N
print(ans)

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

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

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

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

print(ans)

Solution (Python):
import sys
import itertools

import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())

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

    L = n // 2
    res = 0
    while L:
        res += L // 5
        L //= 5
    print(res)


if __name__ == '__main__':
    resolve()

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

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

Solution (Python):
import sys
n = int(input())
if n%2 == 1:
    print(0)
    sys.exit()
else:
    cur_two, cur_ten = 2, 10
    num_two, num_ten = 0, 0
    while cur_two <= n:
        num_two += n//cur_two
        cur_two *= 2
    while cur_ten <= n:
        num_ten += n//cur_ten
        cur_ten *= 5
    print(min(num_two, num_ten))

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

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

print(ans)

Solution (Python):
def main():
    n = int(input())
    if n % 2 == 0 and n >= 10:
        m = n // 2
        k = 5
        m5 = 0
        while k <= m:
            m5 += m // k
            k *= 5
    else:
        m5 = 0

    print(m5)


if __name__ == '__main__':
    main()

Solution (Python):
from math import ceil
def main():
    N = int(input())
    if N%2==1:
        print(0)
        return
    else:
        
        ans = 0
        N //= 2
        while N:
            ans += N//5
            N //= 5
        print(ans)
        return


main()

Solution (Python):









N = int(input())

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

k = 10
cnt = 0
while k <= N:
    cnt += N // k
    k *= 5

print(cnt)

Solution (Python):

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

Solution (Python):

"""
E - Double Factorial
https://atcoder.jp/contests/abc148/tasks/abc148_e

"""
import sys


def solve(N):
    if N % 2:
        return 0
    ans, d = 0, 10
    while True:
        q = N // d
        ans += q
        if q == 0:
            return ans
        d *= 5


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


if __name__ == '__main__':
    main(sys.argv[1:])

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

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

div = 10
ans = 0
while n >= div:
    tmp = n
    ans += tmp // div
    div *= 5

print(ans)

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

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

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

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

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

cnt=0
v=10
while 1:
  cnt+=n//v
  if n//v==0:
    break
  v*=5
print(cnt)

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

Solution (Python):
def solve(N):
    if N%2==1:
        return 0
    N2=(N-N%10)//10
    count_zero=N2
    x=5
    while N2>=x:
        count_zero+=N2//x
        x*=5
    return count_zero
    
        
    

N=int(input())
print(solve(N))

Solution (Python):

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

Solution (Python):
import math

N = int(input())

if N % 2 == 1:
    print(0)
else:
    i = 10
    ans = 0
    while(True):
        a = math.floor(N // i)
        if a < 1:
            break
        ans += a
        i *= 5
    print(ans)

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

k, l = divmod(N, 2)

if l == 1:
    print(0)
else:
    cnt = 0
    while k > 1:
        cnt += k // 5
        k //= 5

    print(cnt)

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

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

Solution (Python):
n=int(input())
ans=0
if n % 2==0:
    for i in range(1,10000):
        waru = 2*5**i
        if n < waru:
            break
        else:
            tmp = n//waru
            ans += tmp
print(str(ans))

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


if __name__ == '__main__':
    main()

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

def solve(n):
    if n % 2 == 1:
        return 0
    n //= 2
    ans = 0
    fact = 5
    while n >= 5:
        ans += n // 5
        n //= 5
    return ans

print(solve(n))

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

p = 10
a = 0
if n % 2 == 0:
    while p <= n:
        a += n // p
        p *= 5
print(a)

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

Solution (Python):
import math

n = int(input())
ans = 0
if n== 0:
  print(0)
  exit()


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

Solution (Python):
import math

n = int(input())
ans = 0
if n== 0:
  print(0)
  exit()
m = math.floor(math.log(n,5))

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

Solution (Python):
from sys import stdin
from sys import exit
def main():
    
    readline=stdin.readline
    n=int(readline())

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

    print(ans)

if __name__=="__main__":
    main()

Solution (Python):


N = int(input())

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


    print(ret)

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

Solution (Python):
import sys
import math

N = int(input())

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

count = 0
digit = math.ceil(math.log(N, 5))
for i in range(1, digit+1):
    x = 5 ** i
    count += (N // (x * 2))
print(count)

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

Solution (Python):

from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
import math

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

if __name__ == "__main__":
    main()

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


def main():
    n = int(readline().rstrip())
    if n % 2 == 1:
        print(0)
    else:
        n = n // 2
        num = 0
        for i in range(1, 100):
            num += n // (5 ** i)
        print(num)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

input = lambda: sys.stdin.readline().rstrip()


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

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

    ans = 0
    div = 10
    while div <= N:
        ans += N // div
        div *= 5

    print(ans)


if __name__ == '__main__':
    solve()

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

Solution (Python):
n = int(input())
if n%2 == 1:
    print(0)
    
else:
    if n < 10:
        print(0)
    else:
        list5 = []
        flag = True
        num = 5
        while flag:
            tmp = n//(num*2)
            if tmp > 0:
                list5.append(tmp)
                num *= 5
            else:
                flag = False
        ans_list = []
        for i in range(len(list5)-1):
            ans_list.append(list5[i] - list5[i+1])
        ans_list.append(list5[-1])
        ans = 0
        for i in range(len(ans_list)):
            ans += ans_list[i]*(i+1)
        print(ans)

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

import sys
if N & 1:
    print(0)
    sys.exit()

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

print(ans)

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

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

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

        cnt+=1
    print(ans)