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

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

a = 1
ans = 0
flag = True
while (N >= 2*5**a) :
    ans += N//(2*5**a)
    a += 1
print(ans)

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

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

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

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

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

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

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

    print(ans)

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

t = 50
w = []
while True:
    x = N // t
    if x == 0:
        break
    else:
        w.append(x)
    t *= 5

if N % 2 == 1:
    ans = 0
else:
    ans = N // 10
    for wi in w:
        ans += wi
print(ans)

Solution (Python):
x = int(input())
result = 0
if x % 2 != 0:
  print(result)
else:
  i = x // 2
  while(i>4):
    i = i // 5
    result += i
  print(result)

Solution (Python):

MOD = 10 ** 9 + 7

import math

import itertools



def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


def main():


    n=int(input())
    nn=n//2
    a=nn//5 
    b = [a//(10**i) for i in range(1,18)]
    c = [a//(5**i) for i in range(1,50)]
    count=0

 
  
    for i in c:
        if i!=0:
            count+=i
 
    if n%2==0:
        print(count+a)
    else:
        print(0)




if __name__ == "__main__":
    main()

Solution (Python):
import copy
n = int(input())
m = copy.copy(n)

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

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

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

x = N
fives = 0
while x:
    x //= 5
    fives += (x//2)
    
    
print(fives)

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

Solution (Python):
import sys

n = int(input())

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

n //= 10
sub_zero = n

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

print(sub_zero)

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

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

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







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

A = [0] * 30
m = 5
for i in range(1, 30):
    A[i] = N // m
    m *= 5
print(sum([a // 2 for a in A]))

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

N = int(input())
if N%2==1:
    print(0)
    exit()
res = 0
M = N//2
a=0
b=0
for keta in range(1,54):
    tmp = M//(2**keta)
    a += tmp
    tmp = M//(5**keta)
    b += tmp

print(min([a,b]))

Solution (Python):
from sys import stdin
f_i = stdin

N = int(f_i.readline())

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

print(ans)

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

n = int(readline())
if n <= 9 or n % 2 == 1:
  print(0)
  quit()
r = n // 10

for j in range(1, 25):
  r += n // ((5 ** j) * 10)

print(r)

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

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

else:
    print(0)


def function(x):
    if x < 2:
        return 1
    else:
        return x * function(x - 2)

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

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

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

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

tmp=[5**i*2 for i in range(1,30)]
tmp1=[n//tmp[i] for i in range(29)]
print(sum(tmp1))

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

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

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

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

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

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

N >>= 1

five_count = 5

ans = 0

while five_count <= N:
    ans += N // five_count
    five_count *= 5

print(ans)

Solution (Python):


from decimal import Decimal

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

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

Solution (Python):
def dobfac(num):
    count = 0
    i = 5
    if num % 2:
        print(0)
    else:
        while num / i > 0:
            count += num // i // 2
            i *= 5
        print(count)

if __name__ == "__main__":
    import sys
    in_str = []
    for line in sys.stdin:
        in_str.append(line)
    dobfac(int(in_str[0]))

Solution (Python):
def count (x):
    i = 5
    zeros = 0
    while x >= i:
        zeros += x // i
        i *= 5
    return int(zeros)
  

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()

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

	ans = 0
	base = 10
	while True:
		if base > N:
			break

		tmp = N // base
		ans += tmp
		base *= 5

	
	
	

	
	
	
	
	
	print(ans)

def goo(val):
	if val < 2:
		return 1
	else:
		bbb = goo(val-2)
		aaa = val * bbb
		
		return aaa

if __name__ == "__main__":
	main()

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

Solution (Python):
a=int(input())
sd=10
count=0
if a%2==0:
    for i in range(100):
        count+=a//sd
        sd*=5
    print(count)
else:
    print("0")

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

if n%2 == 1:
  print(0)
else:
  for i in range(1000):
    j = 2*pow(5,i+1)
    if j <= n:
      fivenum += n//j
  print(fivenum)

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

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

Solution (Python):
from fractions import gcd

def read():
    N = int(input().strip())
    return N,


def list_multiple_of_5(n):
    base = []
    mul = 5
    while mul <= n:
        base.append(mul)
        mul *= 5
    return base

def solve(N):
    if N % 2 == 1:
        return 0
    count = 0
    base10 = N // 10
    count += base10
    m5s = list_multiple_of_5(base10)
    for m5 in m5s:
        count += (base10 // m5)
    return count


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

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



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








def a(n,N):
    n -= n % (2 * N)
    return n // N // 2

s = 0
result = 1
NN = 5
while result:
    result = a(N,NN)
    s += result
    NN *= 5

print(s)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()

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

	ans = 0
	base = 10
	while True:
		if base > N:
			break

		tmp = N // base
		ans += tmp
		base *= 5

	
	
	

	
	
	
	
	
	print(ans)

def goo(val):
	if val < 2:
		return 1
	else:
		bbb = goo(val-2)
		aaa = val * bbb
		
		return aaa

if __name__ == "__main__":
	main()

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

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

Solution (Python):
import sys

s = input()
n = int(s)

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

count = 0
index = 5
while index <= n:
  count += (n // index) //2
  index *= 5
  
print(count)

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

n = int(input())

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

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

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

ans = 0
a = 10
for i in range(10**18):
    if 10*5**i > n:
        break
    ans += n//(10*5**i)
print(ans)

Solution (Python):
import math


def solve_even(n):
    assert(n % 2 == 0)
    k = n // 2
    return leg(k)


def leg(k):
    return sum(k // 5 ** i for i in range(1, int(math.log(k) / math.log(5)) + 1))


n = int(input())

if n % 2 == 0:
    if n == 0:
        print(0)
    else:
        print(solve_even(n))
else:
    if n == 1:
        print(0)
    else:
        print(solve_even(n + 1) - leg(n // 2 + 1))

Solution (Python):
def solve(n):
    if n % 2 == 1:
        return 0
    else:
        m = n // 2
        res = 0
        while m > 0:
            m = m // 5
            res += m
        return res


def main():
    n = int(input())
    res = solve(n)
    print(res)


def test():
    assert solve(12) == 1
    assert solve(5) == 0
    assert solve(1000000000000000000) == 124999999999999995


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

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

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

Solution (Python):
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines







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




	
if __name__ == "__main__":
	main()

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

Solution (Python):
n = int(input())
if n % 2 == 1:
    print(0)
    exit()
time_5 = 1
cnt = 0
while time_5 < n:
    cnt += 1
    time_5 *= 5    
ans = 0
for i in range(1, cnt):
    mod_10 = n // (5 ** i * 2)
    ans += mod_10
print(ans)

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

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

Solution (Python):
def main():
    n = int(input())
    if n % 2 != 0:
        print(0)
        return 0
    cnt5 = 0
    n = n//2
    for i in range(1, 36):
        cnt5 += (n//5)
        n //= 5
    print(cnt5)


main()

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

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

    r = N // 2
    c = 0
    while r >= 5:
        c += r // 5
        r //= 5

    print(c)

if __name__ == "__main__":
    main()

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

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

if N % 2 == 1:
    print(0)
else:
    res_two = 0
    res_five = 0
    for i in range(1, 100):
        if N // (2 ** i) == 0:
            break
        res_two += N // (2 ** i)
    for i in range(1, 100):
        if N // (5 ** i) == 0:
            break
        res_five += N // (5 ** i) // 2
    print(min(res_two, res_five))

Solution (Python):
n=int(input())
z=1
a=0
if n%2==0:
  for i in range(100):
    z*=5
    if n<z:
      break
    t=n//z
    a+=(t-int(t%2==1))//2
  print(a)
else:
  print(0)

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

Solution (Python):
N=int(input())
if N%2==1:
  print(0)
else:
  a=len(str(N))
  counter=0
  i=5
  while N>=i:
    x=N//i
    x//=2
    counter+=x
    i*=5
  print(counter)

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










result = 0
for i in range(100):
    
    result += N//((5**(i+1))*2)
print(result)

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

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

Solution (Python):
N = int(input())
if N%2==1:
    print(0)
else:
    n = N//2
    a = n
    cnt = 0
    while a>1:
        cnt += a//2
        a = a//2
    a = cnt
    b = n
    cnt = 0
    while b>1:
        cnt += b//5
        b = b//5
    b = cnt
    c = n
    cnt = 0
    while c>1:
        cnt += c//10
        c = c//10
    c = cnt
    n2 = a-c+n
    n5 = b-c
    print(c+min(n2,n5))

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

Solution (Python):
N = int(input())
def g(n):
  ret = 0
  while(n >= 5):
    n = n // 5
    ret += n
  return ret

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

Solution (Python):

import sys


def solve(N: int):

    if N % 2 == 1:
        print(0)
    else:
        ans = N // 10
        for i in range(1, 100000):
            tmp = N // (10 * (5**i))
            if tmp == 0:
                break
            ans += tmp
        print(ans)
    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:
    s=0
    t=1
    while 2*(5**t)<=n:
        s+=n//(2*(5**t))
        t+=1
    print(s)

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

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

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

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

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

for i in range(80):
    if 2*5**(i+1)<=n:
        count+=n//(2*5**(i+1))
    else:
        break
print(count)

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

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

else:
    res = 0
    res += N // 10
    a = 50
    while a <= N:
        res += N // a
        a *= 5
    print(res)

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

ans = 0
i = 1

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

Solution (Python):
from sys import stdin 
n = int(stdin.readline().rstrip())
k = 10
answer = 0
if n % 2 == 1:
    print(0)
else:
    while n >= k:
        answer += n // k
        k *= 5
    print(answer)

Solution (Python):
from math import log10, floor

N = int(input())

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
















NN = N // 2
count = 0
i = 1

while True:
    ans = NN // 5 ** i
    if ans == 0:
        break
    
    NN = NN // 5
    
    count += ans
    
print(count)

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

if N % 2 == 1:  
    print(0)
else:
    ans = 0
    pow50 = 50
    while pow50 <= N:
        ans += N//pow50
        pow50 *= 5
    gozyu_baisuu = N//50
    zyuu_baisuu = N//10
    
    print(ans + zyuu_baisuu)

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

def f(num):
    num = num - int(str(num)[-1])
    count = 0
    i = 1
    while True:
        if ((5 ** i) * (2)) > num:
            break
        count += (num // ((5 ** i) * (2)))
        i += 1
    return count




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

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

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

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

if N % 2 != 0:
    print(0)
else:
    a = N // 10
    b = a
    t = 0
    while b:
        tmp = b // 5
        t += tmp
        b = tmp
    print(a + t)

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

Solution (Python):
N=int(input())
if N%2==1:
    print(0)
else:
    n=N
    A=0
    while n>=10:
       A+=n//10
       n//=10
    C=N//10
    B=N//50
    for i in range(1,100):
        B+=N//(50*(5**i))
    print(B+C)

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

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

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

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

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

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

  print(Ans)

Solution (Python):
N=int(input())
i=1
result=0

if N%2==0:
    while 5**i<=N:
        Ndiv=N//(5**i)
        pmax=Ndiv*(5**i)
        result+=Ndiv//2
        i+=1

print(result)

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

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

    print(ans)

Solution (Python):
n = int(input())
five = 0
two = 0

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

x = 2
while x <= n:
  two += n // x
  x *= 2

x = 5
while x*2 <= n:
  five += n // (x*2)
  x *= 5

print(min(two, five))

Solution (Python):
import math as m

N = int(input())
if N < 2 or N % 2 == 1:
    print(0)
    exit()
ans = 0
digit = 1
while N // (2 * pow(5, digit)):
    ans += N // (2 * pow(5, digit))
    digit += 1
print(ans)

Solution (Python):


import itertools


def count_trailing_zeros(n):
    if n % 2 == 1:
        return 0
    else:
        res = 0
        for i in itertools.count(1):
            p = 5 ** i
            if p > n:
                break
            res += n // (2 * p)
        return res


def main():
    n = int(input())
    res = count_trailing_zeros(n)
    print(res)


if __name__ == "__main__":
    main()

Solution (Python):
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''

gi = lambda : list(map(int,input().split()))
n, = gi()
ans = n // 10
cur = 50
while cur <= n:
	ans += n // cur
	cur *= 5
if n % 2:
	ans = 0
print(ans)

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    if n % 2 == 0:
        cnt = 0
        for i in range(1, 10 ** 10):
            pw = pow(5, i)
            if pw <= n:
                cnt += n // pw // 2
            else:
                print(cnt)
                exit()
    else:
        print(0)


if __name__ == '__main__':
    solve()

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

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

Solution (Python):

n = int(input())
def func(n):
    flag = True
    ans = 0
    i = 5
    while flag == True:
        temp = n // (i *2)
        ans += temp
        i = i*5
        if temp == 0:
            flag = False
    return ans

if (n % 2 )!= 0:
    print(0)
else:
    print(func(n))

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

num_5 = n//2//5

mul_5 = 5
while mul_5 <= n:
    cnt += n//2//mul_5
    mul_5 = mul_5*5
print(cnt)

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

ans = 0
if N%2 == 0:
    num2 = 0
    d = 2
    while d <= N:
        num2 += N//d
        d *= 2

    num5 = 0
    d = 10
    while d <= N:
        num5 += N//d
        d *= 5

    ans = min(num2, num5)

print(ans)

Solution (Python):

def solve():
    n=int(input())
    if n<2:
        return 0
    out=0
    if n%2==0:
        while n>=10:
            n//=5
            out+=n//2
            
        return out
    else:
        return 0
    
    

print(solve())

Solution (Python):


def solve():
    N = int(input())
    if N % 2:
        res = 0
    else:
        q = 10
        p5 = 0
        while N // q:
            p5 += N // q
            q *= 5
        q = 2
        p2 = 0
        while N // q:
            p2 += N // q
            q *= 2
        res = min(p2, p5)
    return str(res)

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

Solution (Python):
import sys
import math
import re
import io

def query(n, m):
    ans = 0
    while n > 0:
        ans += n // m
        n //= m
    return ans

def solve(n):
    if n < 2:
        return 0
    if n % 2 == 0:
        return query(n // 2, 5)
    return 0

def main():
    n = int(input())
    ans = solve(n)
    print(ans)

if __name__ == "__main__":
    main()

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

Solution (Python):
import math
import sys

m=10**9 + 7 
N  = int(input())

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

x = 10 
fives = 0 
for i in range(1,27):
    fives = fives + ( N // x )
    x = x * 5

print(fives)

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

cnt = 0
M = 5 * 2
while M <= N:
    cnt += N // M
    M *= 5
print(cnt)

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

Solution (Python):

import sys
INF = float("inf")


def f(n):
    ans = 1
    while True:
        if n < 2:
            break
        ans *= n
        n -= 2
    return ans


def solve(N: int):
    if N % 2 == 1:
        print(0)
        return

    
    
    

    
    
    

    
    
    
    
    
    
    
    
    
    
    

    tot = 0
    base = 5
    while base <= N:
        tot += (N//base)//2
        base *= 5
    print(tot)

    
    
    
    
    
    

    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:
    print(0)
else:
    ans = 0
    for i in range(1, 40):
        ans += (N // (2 * (5**i)))
    print(ans)

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

Solution (Python):
import sys
def I(): return int(sys.stdin.readline())
def LI(): return [int(x) for x in sys.stdin.readline().split()]

def main():
    N = I()
    if N%2==1:
        print(0)
        return

    ans = 0
    ans += N//10
    q = 50
    while(N//q>0):
        ans += N//q
        q *= 5

    print(ans)

if __name__ == "__main__":
    main()

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

Solution (Python):
N = int(input())
d = [0 for i in range(31)]
b = 0
if N % 2 == 0:
    for i in range(30):
        x = 30 - i
        y = 5**x
        a = (N//y)//2
        d[x] = a - b
        b = a
    ans = 0
    for i in range(1,31):
        ans += (d[i]*i)
else:
    ans = 0
print(ans)

Solution (Python):
N = int(input())
if N%2==1:
  print(0)
  
elif N<=4:
  print(0)

else:
  a = 0
  while N>5**a:
    a+=1
    
  a-=1
  ans = 0
  for i in range(1,a+1):
    ans += N//(5**i)//2
    
  print(ans)

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

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

def zeros(n):
    count = 0
    cur = n
    while(cur != 0 and cur % 10 == 0):
        cur = cur // 10
        count += 1
    return count

def est(n):
    ev = n // 10
    divider = 50
    while(n // divider != 0):
        ev += n // divider
        divider *= 5
    return ev

if N % 2 == 1:
    print(0)
else:
    print(est(N))

Solution (Python):
import sys

def solve():
    N = int(input())
    if N % 2 == 1: print(0)
    else: 
        ans = 0
        for i in range(18):
            ans += N // pow(10, i+1)
            fd = 5 * pow(10, i+1)
            while fd <= N:
                ans  += (N // fd + 1) // 2
                fd *= 5
        print(ans)
    
    return 0

if __name__ == "__main__":
    solve()

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys


N = int(input())

def solve(N):
    if N % 2 == 1:
        return 0
    else:
        num_10 = N // 10

        k = 50
        num_5 = 0
        while k < 1e19:
            num_5 += N // k
            k *= 5

        return num_10 + num_5





    



















print(solve(N))

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
N = int(input())
print(0 if N&1 else sum([N//10//5**i for i in range(99)]))

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

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

Solution (Python):


def cnt_five(n):
    i = 1
    cnt = 0
    while 5 ** i <= n:
        cnt += n // (5 ** i)
        i += 1
    return cnt

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

Solution (Python):
import math
def main():
    N = int(input())
    if N < 5:
        return 0
    if N % 2 == 1:
        return 0
    t = int(math.log(N, 5))
    a = 0
    for i in range(1, t+1):
        a += N // (2 * (5 ** i))
    return a
print(main())

Solution (Python):
import sys

n = int(sys.stdin.readline().rstrip())

def main():
    if n & 1:
        return 0
    ans = 0
    for i in range(30):
        ans += n // (10 * 5 ** i)

    return ans

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

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

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

    while (n > 1):
        k = n//5
        ans += k
        n = k
    print(ans)

Solution (Python):

n = int(input())
ans = n//10
t = 50

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


print(ans)

Solution (Python):
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


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


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]



def A():
    a = I()
    b = I()
    print(6 - a - b)
    return



def B():
    n = I()
    s, t = input().split(' ')
    ans = []
    for i in range(n):
        ans.append(s[i])
        ans.append(t[i])
    print(''.join(ans))
    return



def C():
    def GCD(a, b):
        if (b == 0):
            return a
        else:
            return GCD(b, a % b)

    a, b = LI()
    print(a * b // GCD(a, b))
    return



def D():
    n = I()
    a = LI()
    cnt = 0
    for i in range(n):
        if a[i] == cnt + 1:
            cnt += 1
    if cnt == 0:
        print(-1)
    else:
        print(n - cnt)
    return



def E():
    n = I()
    if n % 2 != 0:
        print(0)
        return
    ans = 0
    i = 10
    while 1:
        if i > n:
            break
        ans += n // i
        i *= 5
    print(ans)
    return



def F():
    return



def resolve():
    E()
    return



if __name__ == "__main__":
    E()