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 math
N = int(input())

if N%2 != 0:
  answer = 0
else:
  answer = 0
  m = 1
  while math.floor(N)//(2*5**m) > 0:
    answer += math.floor(N//(2*5**m))
    m += 1 
print(answer)

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

Solution (Python):
N = int(input())
ans = 0
m = 10
if N & 1:
    print(0)
    exit()
while N >= m:
    ans += N//m
    m *= 5
print(ans)

Solution (Python):
def run():
  N = int(input())
  if N%2 == 1:
    print(0)
    exit()
  k = 1
  while N > 5**k:
    k += 1
  ans = 0
  for i in range(1, k):
    ans += N//((5**i)*2)
  print(ans)
    
  
if __name__ == '__main__':
  run()

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

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

Solution (Python):
def main():
    N = int(input())
    if N & 1:
        return print(0)
    ans = 0
    di = 10
    while di <= N:
        ans += N//di
        di *= 5
    print(ans)


if __name__ == '__main__':
    main()

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

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

a1  = N // 10
a2  = N // 100
a3  = N // 1000
a4  = N // 10000
a5  = N // 100000
a6  = N // 1000000
a7  = N // 10000000
a8  = N // 100000000
a9  = N // 1000000000
a10 = N // 10000000000
a11 = N // 100000000000
a12 = N // 1000000000000
a13 = N // 10000000000000
a14 = N // 100000000000000
a15 = N // 1000000000000000
a16 = N // 10000000000000000
a17 = N // 100000000000000000
a18 = N // 1000000000000000000
a19 = N // 10000000000000000000

b1  = (N // 50) - a2
b2  = (N // 250  ) - a3
b3  = (N // 1250 ) - a4
b4  = (N // ((5**4)*10) ) - a5
b5  = math.ceil(N // ((5**5)*10 )) - a6
b6  = math.ceil(N // ((5**6)*10 )) - a7
b7  = math.ceil(N // ((5**7)*10 )) - a8
b8  = math.ceil(N // ((5**8)*10 )) - a9
b9  = math.ceil(N // ((5**9)*10 )) - a10
b10 = math.ceil(N // ((5**10)*10) ) - a11
b11 = math.ceil(N // ((5**11)*10) ) - a12
b12 = math.ceil(N // ((5**12)*10) ) - a13
b13 = math.ceil(N // ((5**13)*10) ) - a14
b14 = math.ceil(N // ((5**14)*10) ) - a15
b15 = math.ceil(N // ((5**15)*10) ) - a16
b16 = math.ceil(N // ((5**16)*10)) - a17
b17 = math.ceil(N // ((5**17)*10) ) - a18
b18 = math.ceil(N // ((5**18)*10) ) - a19
b19 = math.ceil(N // ((5**19)*10) )
b20 = math.ceil(N // ((5**20)*10) )
b21 = math.ceil(N // ((5**21)*10) )
b22 = math.ceil(N // ((5**22)*10) )
b23 = math.ceil(N // ((5**23)*10) )
b24 = math.ceil(N // ((5**24)*10) )
b25 = math.ceil(N // ((5**25)*10) )
b26 = math.ceil(N // ((5**26)*10) )


ans = a1*1 + a2*1+ a3*1+ a4*1 + a5*1+ a6*1+ a7*1+ a8*1+ a9*1+ a10*1+ a11*1+ a12*1+ a13*1+ a14*1+ a15*1+ a16*1+ a17*1+ a18*1+ a19*1
ans = ans + b1*1 + b2*1+ b3*1+ b4*1 + b5*1+ b6*1+ b7*1+ b8*1+ b9*1+ b10*1+ b11*1+ b12*1+ b13*1+ b14*1+ b15*1+ b16*1+ b17*1+ b18*1 + b19+b20+b21+b22+b23+b24+b25

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

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

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

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







INF = 500000
MOD = 10**9+7

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

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

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


if __name__ == '__main__':
    solve()

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

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

cnt = 0
j = 10
for i in range(25):
    cnt += n // j
    j *= 5
print(cnt)

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

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

print(ans)

Solution (Python):
n = int(input())
p = 10
su = 0
while p <= n:
   su += n//p
   p*=5

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

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

five = 5
ten = 10
cnt5 = 0
cnt10 = 0

if N % 2 == 1:
    ans = 0
else:
    while True:
        cnt5 += (N // 2) // five
        five *= 5
        if five > N:
            break
    ans = cnt5
print(int(ans))

Solution (Python):
from math import factorial
import math
N=int(input())
org=N
b=[]


while N>=5:
  N=N//5
  b.append(N)

ans=0
N=org
if N%2==0:
  for i, item in enumerate(b):
      ans+=item//2
     
print(ans)

Solution (Python):
n=int(input())
ans=0
if n%2==0:
    num=len(str(n))*2
    
    ans=0
    for i in range(num):
        ans+=n//(10*(5**i))
print(int(ans))

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

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

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


cntTen=0
temp=1
while 2*5**temp <= n:
    cntTen+=n//(2*5**temp)
    temp+=1



print((int(cntTen)))

Solution (Python):
N = int(input())
l = len(str(N))
if N < 2:
    print(0)
elif N % 2 == 1:
    print(0)
else:
    ans = 0
 
    for i in range(1, 2*l):
        tmp = 0
        ans += (N // 10**i)
        tmp += (N // (10 * (5**i)))
        tmp -= N // (10 * (10**i))
        ans += max(tmp, 0)
 
    print(ans)

Solution (Python):
N = int(input())
l = len(str(N))
if N < 2:
    print(0)
elif N % 2 == 1:
    print(0)
else:
    ans = 0
 
    for i in range(1, 2*l):
        tmp = 0
        ans += (N // 10**i)
        tmp += (N // (10 * (5**i)))
        tmp -= N // (10 * (10**i))
        ans += max(tmp, 0)
 
    print(ans)

Solution (Python):

import sys

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

Solution (Python):
"""
Atcoder_Beginner_Contest_148
E - Double Factorial
https://atcoder.jp/contests/abc148/tasks/abc148_e
"""
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000000)

N = int(input())

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

zero_count = 0
divide_number = 10
while divide_number <= N:
    zero_count += N // divide_number

    
    divide_number *= 5

print(zero_count)

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

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

Solution (Python):
N = int(input())
l = len(str(N))
if N < 2:
    print(0)
elif N % 2 == 1:
    print(0)
else:
    ans = 0
 
    for i in range(1, 2*l):
        tmp = 0
        ans += (N // 10**i)
        tmp += (N // (10 * (5**i)))
        tmp -= N // (10 * (10**i))
        ans += max(tmp, 0)
 
    print(ans)

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

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

Solution (Python):
N = int(input())
l = len(str(N))
if N < 2:
    print(0)
elif N % 2 == 1:
    print(0)
else:
    ans = 0

    for i in range(1, 2*l):
        tmp = 0
        ans += (N // 10**i)
        tmp += (N // (10 * (5**i)))
        tmp -= N // (10 * (10**i))
        ans += max(tmp, 0)

    print(ans)

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

Solution (Python):
def even(n):
    count = 0
    i = 10
    while(n/i>=1):
        count += n//i
        i *= 5
    return int(count) 

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

    if N < 2:
        print(0)

    
    elif N % 2 == 0:
        print(even(N))
    
    elif N % 2 == 1:
        print(0)

if __name__ == "__main__":
    main()

Solution (Python):
def even(n):
    count = 0
    i = 10
    while(n/i>=1):
        count += n//i
        i *= 5
    return int(count) 

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

    if N < 2:
        print(0)

    
    elif N % 2 == 0:
        print(even(N))
    
    elif N % 2 == 1:
        print(0)

if __name__ == "__main__":
    main()

Solution (Python):
i = int(input())
if i % 2 == 0:
    now = 0
    for j in range(1000):
        now += i // (10 * (5 ** j))
    print(now)
else:
    print(0)

Solution (Python):
N = int(input())
if N%2 ==1 or N ==2:
    print(0)
else:
    half = N//2
    sumone=0
    p=1
    while 5**p <=half:
        sumone += half//(5**p)
        p+=1
    
    print(sumone)

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

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

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

if N % 2 != 0:
    print(0)
else:
    count = N // 10
    for j in range(1, 50):
        count += N // ((5**j) * 10)
    print(count)

Solution (Python):
from sys import stdin


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

    a = N // 50
    b = N // 10

    ans = a + b

    for i in range(2, N):
        x = (5 ** i) * 10
        y = N // x
        if y == 0:
            break
        ans += y

    return ans


def main():
    N = int(stdin.readline().rstrip())
    result = solve(N)
    print(result)


if __name__ == "__main__":
    main()

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

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

n = n // 10
ans = n

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

print(ans)

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

ans = 0

d = 5
while True:
    if d > N:
        break
    c = N // d
    ans += c // 2
    d *= 5

print(ans)

Solution (Python):


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

N = int(input())














number = 0
seed = 10
if (N % 2 == 0):
    while seed < 10**18:
        number += N // seed
        seed = seed * 5
        
    print(number)
else:
    print(0)

Solution (Python):
import sys
bbn=1000000007
	


def ai(n, c):
	if n <= 9550:
		bb=1	
		ret=0
		while n >= 10**bb:
			ret += n // 10**bb
			bb+=1
		return ret+c
	else:
		p=0
		b=n
		while b % 10 == 0:
			p+=1
			b=b//10
		return ai(n-2, c+p)
		
def main():
	n = int(input())
	if n%2==1:
		return 0
	bb=1	
	ret=0
	while n >= 2*(5**bb):
		ret += n // (2*(5**bb))
		bb+=1
	
	print(ret)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

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

n = int(read())
ans = 0
if n % 2 == 1:
    pass
else:
    cnt = 0
    acc = 5
    while acc <= n:
        cnt += (n // acc) // 2
        acc *= 5
    ans = cnt

print(ans)

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

Solution (Python):


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

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


    n = N // 10
    a = 50
    while a <= N:
        n += N // a
        a *= 5

    print(n)

if __name__ == "__main__":
    resolve()

Solution (Python):




N = int(input().split()[0])

if N % 2 == 0:
    n = (N // 2) // 5
    total_n = n
    count = 2
    while n >= 5:
        p = (N // 2) // (5 ** count)
        total_n += p
        count += 1
        if p <= 0:
            break
        
        
        
        
        
        
        
        
        
    ans = total_n
else:
    ans = 0

print(ans)

Solution (Python):
import math
n = input()
n = int(n)
summ=0
count = 0
if(n%2==1): print("0")
else:
    while(n/5>0):
        if(count==0): 
            n=str(n)
            n=n[0:len(n)-1]
            if(len(n)==0): break
            else: n=int(n) 
            count+=1
        else:
            n = n*2
            n=str(n)
            n=n[0:len(n)-1]
            if(len(n)==0): break
            else: n=int(n)            
        
        summ+=n
    print(summ)

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

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

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

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

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

Solution (Python):
def count_2(n):
	d = 2
	c = 1
	while d <= n:
		d *= 2
		c += 1
	
	prev_count = 0
	total_count = 0
	
	while d >= 2:
		count = n // d

		total_count += (count - prev_count) * c
		prev_count = count
		d //= 2
		c -= 1
	
	return total_count


def count_5(n):
	d = 5
	c = 1
	while d <= n:
		d *= 5
		c += 1
	
	prev_count = 0
	total_count = 0
	
	while d >= 5:
		count = n // d

		total_count += (count // 2 - prev_count // 2) * c
		prev_count = count
		d //= 5
		c -= 1
	
	return total_count

def count_0(n):
	if n % 2 == 0:
		count2 = count_2(n)
		count5 = count_5(n)
		return min(count2, count5)
	else:
		return 0
print(count_0(int(input())))

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

Solution (Python):

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

result =  N // 10
for i in range(1, 30):
    result +=  Nby // (5 ** i)

print(result)

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

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

if n % 2 == 0:
    result = n // 10
    num = n//10
    while 1 <= num / 5:
        num //= 5
        result += num
    if 5 < num:
        result += 1
    print(result)
else:
    print(0)

Solution (Python):
from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 6)


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


def solve(N):
    result = f(N)
    count = 0
    for x in str(result)[::-1]:
        if x == '0':
            count += 1
        else:
            break
    return count


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

    a = N // 50
    b = N // 10

    ans = a + b

    for i in range(2, 100000000000):
        x = (5 ** i) * 10
        y = N // x
        if y == 0:
            break
        ans += y

    return ans

    
    
    
    


def main():
    N = int(stdin.readline().rstrip())
    result = solve2(N)
    print(result)

    
    

    
    
    
    

    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    


if __name__ == "__main__":
    main()

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

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


count = 0
start = 10
start_lis = []
while start <= N:
    start_lis.append(start)
    start = start // 2
    if int(str(start)[-1]) == 5:
        start *= 10
        
tmp10 = 10
while True:
    count += N // tmp10
    tmp10 *= 10
    if tmp10 > N:
        break

for i in range(1, len(start_lis)):
    tmp = start_lis[i]
    while True:
        count += (N + tmp) // (tmp * 2)
        tmp *= 10
        if tmp > N:
            break

print(count)

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

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

chk = False
chk1 = True
bis = 5
ans = 0
if (n % 2 ==1) or (n<10):
    print(0)

else:
    
    
    
    
    
            
    while n > bis:
        
        ans += n // (bis*2)
        bis = bis *5

        
        
    print(ans)

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

Solution (Python):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

N=one_int()

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

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

if n % 2 == 1:
  print(0)
  
elif n < 9:
  print(0)
else:
  count = 0
  for i in range(30):
    sub = 10 * (5**i)
    count += n // sub
    
    if sub > n:
      break
      
  print(count)

Solution (Python):

N = int(input())

if N%2==1:
    print(0)
else:
    ans = 0
    num = 0
    tmp = N
    while (tmp>49):
        num += tmp//50
        tmp //= 5
    ans += N//10
    ans += num
    print(ans)

Solution (Python):
n = int(input())
if n%2 == 1:
    print(0)
else:
    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)
  exit()
def func1(n):
  if n==0:
    return 0
  if n==1:
    return 1
  return 5*func1(n-1)+1
def func(x):
  if x==0:
    return 0
  for i in range(26):
    if x<5**(i+1):
      a=i
      b=x//(5**a)
      c=x%(5**a)
      break
  return b*func1(a)+func(c)
print(func(N//2))

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

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

if N%2==1:
    print(0)
else:
    f=[0 for _ in range(25)]
    for i in range(25,0,-1):
        f[i-1]=N//(5**i*2)
        o=sum(f)
    print(o)

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

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

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

print(a)

Solution (Python):
def fac0(a):
    r = 0
    while a > 0:
        r += a//5
        a = a//5
        
        
    return(r)

N = int(input())




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

Solution (Python):
import sys

str = sys.stdin.readline()

N = int(str)

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

    print(ans)

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

Solution (Python):
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var):
    print(*var, file=sys.stderr)

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))




n, = I()
if n % 2:
    print(0)
    exit()

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())

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

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

if n % 2 != 0:
    print(0)
    exit()
count = 0
for i in range(35):
    a = 5 ** i * 10
    b = n // a
    count += b


print(count)

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

if N%2 == 0:
    count = 0
    check = N//2
    n = 5
    while True:
        if check >= n:
            count += check//n
            n *= 5
        else:
            print(count)
            
            break
        
else:
    print(0)

Solution (Python):
def f(n):
  if n%2==1: return 0
  else:
    i,m = 1,0
    while n>=5**i:
      m += n//(5**i)//2
      i += 1
    return m

N = int(input())
print(f(N))

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

Solution (Python):

N=input()

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

ans=0
N/=10
ans+=N

while 0<N:
    N/=5
    ans+=N
print ans

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

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

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

p=0
q=1
for i in range(N):
  if q*5 <= N:
    q = q*5
    p = p+1
  else:
    break

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

Solution (Python):
from math import log
N = int(input())

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

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

if N%2==1:
    print(0)
else:
    count2=0
    count5=0
    n=N

    while(n//2>0):
        count2 += n//2
        n //= 2

    m=N//2

    while(m//5>0):
        count5 += m//5
        m //= 5

    print(min(count2,count5))

Solution (Python):
import math 
n = int(input())
p = 0
if n % 2 == 1:
    print(0)
else:
    j = 5
    while j <= n:
        p += n // j // 2
        j *= 5
    print(p)

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

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

res = 0

c = 1
res += N // 10
N //= 10
while N // 5 ** c > 0:
    res += N // 5 ** c
    c += 1
print(res)

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


else: 
    ans=0
    i=0
    while N>=10*5**i:
        ans+=N//(10*5**i)
        i+=1
    print(ans)

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

ans = N // 10

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

def main():
	N = INT()
	if N % 2:
		print(0)
	else:
		fives = 0
		for i in range(1, 27):
			if N//2 >= 5**i:
				fives += (N//2)//(5**i)
		print(fives)

if __name__ == '__main__':
	main()

Solution (Python):
from math import log, ceil
N = int(input())

out = 0

if N%2 != 0 or N == 0:
    print(0)    
else:
    for i in range(1,ceil(log(N,5))):
            out += N//(2*5**i)
    print(out)

Solution (Python):

n=int(input())

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

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

Solution (Python):
import sys,collections,math,random;sys.setrecursionlimit(10**7)
from fractions import gcd
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n = I()
if n%2 == 1:
    print(0)
    exit()
lis = []
for i in range(1,26):
    lis.append((n // (5**i))//2 )
print(sum(lis))

Solution (Python):
def calc(a,n):
    num = 50
    while n >= num:
      a += n//num
      num *= 5
    return a

n = int(input())

if n % 2 == 1:
  print(0)
  exit()
else:
  a = n // 10  
  print(calc(a,n))

Solution (Python):
N=int(input())
if N%2:
    print(0)
    exit()
r=0
x=30
y=0
for i in range(30):
    t=N//2//5**x
    r+=(t-y)*x
    x-=1
    y=t
print(r)

Solution (Python):
import unittest


class TestE(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(12), 1)

    def test_2(self):
        self.assertEqual(think(5), 0)

    def test_3(self):
        self.assertEqual(think(1000000000000000000), 124999999999999995)


def solve():
    n = read()
    result = think(n)
    write(result)


def read():
    return read_int(1)[0]


def read_int(n):
    return read_type(int, n)


def read_float(n):
    return read_type(float, n)


def read_type(t, n):
    return list(map(lambda x: t(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n):
    if n == 0:
        return 0
    if n % 2 == 1:
        return 0
    return count_fives(n // 2)


def write(result):
    print(result)


def count_fives(n):
    count = 0
    mode = 5
    while mode <= n:
        count += n // mode
        mode *= 5
    return count


if __name__ == '__main__':
    
    solve()

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

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

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

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

Solution (Python):
import math
import sys


N = int(input())

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

ans = 0
warusu = math.log(N, 5)
warusu = int(warusu)

for i in range(warusu):
    ans += (N // (5 ** (i+1))) // 2


print(ans)

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

res = 0
if n % 2 == 0:
    m = n // 2
    while m >= 5:
        res += m // 5
        m //= 5

print(res)

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

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

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


res=0
for k in range(1,40):
    tmp=N//(5**k)
    if tmp==0:
        break
    
    res+=(tmp//2)

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

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

if n==0:
    print(0)

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

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time
from fractions import gcd



def I(): return int(input())


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


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


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


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['No', 'Yes']
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']


show_flg = True
show_flg = False


def factorization(n):
    """
    素因数分解
    :param int n:
    :rtype: list of int
    """
    if n <= 1:
        return []

    ret = []
    while n > 2 and n % 2 == 0:
        ret.append(2)
        n //= 2
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            ret.append(i)
            n //= i
        else:
            i += 2
    ret.append(n)
    return ret


def main():
    N = I()
    n = 5
    ans = 0

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


if __name__ == '__main__':
    main()

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

def df(n):
    if n == 0 or n == 1:
        return 0
    elif n % 2 == 1:
        return 0
    else:
        memo = {}
        ans = 0
        def calc(x):
            if x == 0:
                return 0
            if x not in memo:
                memo[x] = calc(x - 1) * 5 + 1
            return memo[x]

        while n >= 50:
            x = n // 2
            c = 0
            while x >= 5:
                x /= 5
                c += 1
            ans += calc(c)
            n -= 5 ** c * 2
        ans += n // 10
        return ans

print(df(N))

Solution (Python):
import math
n = int(input())
ans = 0
if n == 0 or n%2 == 1:
  print(0)
  exit()
x = n//2
y = int(math.log(x,5))
for i in range(1,y+1):
  ans += x//5**i
print(ans)

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

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

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

n = int(input())

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

else:
    d = 5
    c = 0
    while d < n:
        c += (n // d) // 2
        d *= 5
    print(c)