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



Sample input:
12


Sample output:
1

Submission status: Runtime Error

Solution code:
n = int(input())
p = 10
su = 0
while p <= n:
   su += math.floor(n//p)
   p*=5

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)
N = int(input())
def f(n):
    if n < 2:
        return 1
    else:
        return n * f(n - 2)

x = f(N)
out = 0
while True:
    if x % 10 == 0:
        x /= 10
        out += 1
    else:
        break

print(out)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''


def func(n):
    if n == 1:
        return 1
    elif n == 2:
        return 2
    else:
        return n * func(n-2)


def main():
    N = int(input())
    f = func(N)
    count = 0
    for s in str(f):
        if s != "0":
            count = 0
        else:
            count += 1
    # print(f, str(count))

    if N % 2 == 0:
        digit = len(str(N))
        n1 = 10
        n2 = 50
        d0 = 0
        for _ in range(digit-1):
            d0 += N // n1
            d0 += ((N // n2) - (N // (n1*10)))
            n1 *= 10
            n2 *= 10
    else:
        d0 = 0

    print(d0)



if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

x = f(N)
out = 0
while True:
    if x % 10 == 0:
        x /= 10
        out += 1
    else:
        break

print(out)

Submission status: Runtime Error

Solution code:
N = int(input())
class DFactorial(self, n):
  if N < 2:
    return 1
  else:
    n * DFactorial(n-2)

print(DFactorial(N))

Submission status: Runtime Error

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

x = f(N)
out = 0
while True:
    if x % 5 == 0:
        x /= 5
        out += 1
    else:
        break

print(out)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=0
for i in range(18):
  ans+=int(n/(10**(i+1))*(i+1)
print(ans)

Submission status: Runtime Error

Solution code:
def f(n):
    if n < 2:
        return 1
    else:
        ans = n * f(n-2)
    return ans

N = int(input())

start = N % 2
ans = 1
while start != N:
    ans = (start + 2) * ans
    start += 2

ans = list(ans)
co = 0
for i in range(1,len(ans)):
    if ans[-i] == 0:
        co += 1
    else:
        break

print(co)

Submission status: Runtime Error

Solution code:
def a(n):
  if n<2:
    return 1
  elif n>=2:
    return n*a(n-2)

  
n = int(input()) 
an = a(n)
flag=1
cnt=0
while flag:
  if an is 0:
    break
  an,mod=divmod(an, 10)
  cnt+=1
  if mod>0:
    cnt-=1
    flag=0

print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
a = str(N)[0]+"0"
if N%2==1:
  print(0)
else:
  if N >= 24:
    print(int(a)**(len(str(N))-2)+25*10**(len(str(N))-4)-5)
  else:
    print(int(a)**(len(str(N))-2))

Submission status: Runtime Error

Solution code:
N = int(input())

f = [0]*(N + 1)
f[0] = 1
f[1] = 1
for i in range(2, N + 1):
    f[i] = i * f[i - 2]

count = 0
while f[N] % 10 == 0:
    count += 1
    f[N] = f[N] // 10
    #print(count, f[N])

print(count)

if N % 2 == 1:
    print(0)
if N % 2 == 0:
    N_keta = len(str(N)) - 1

    num_10 = list()
    num_50 = list()
    for i in range(1, N_keta + 1):
        num_10.append(N // (10**i))
    sum_10 = sum(num_10)
    
    for i in range(1, N_keta + 1):
        num_50.append((N // (5 * (10**i))))

    print(num_50)
    for i in range(0, len(num_10) - 1):
        num_50[i] -= num_10[i+1]
    

    print(num_50)
    sum_50 = sum(num_50)
    print(sum_10 + sum_50)

Submission status: Runtime Error

Solution code:
def func(a):
    if a < 2:
        return 1
    else:
        return a*func(a)
 
num = input()
 
a = str(func(num))
 
count = 0
for i in reverse(range(a)):
	if a[i] == 0:
        count = 1+count
    else:
        break
print(count)

Submission status: Runtime Error

Solution code:
def func(n):
  if (n == 0) | (n == 1):
    return 1
  else:
    return n * func(n - 2)

N = int(input())
val = func(N)
count = 0
while val % 10 == 0:
  val = int(val / 10)
  count += 1

print(count)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
# print(f(n))
r=0
# for i in range(2,n+1,2):
#     r += math.log10(i)
#     print(r)
print(int(math.log10(n)))

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10000000)
def func(a):
    if a < 2:
        return 1
    return a * func(a - 2)

n = int(input())
return_num = func(n)


count = 0
while 1:
    if return_num % 10 == 0:
        count += 1
        return_num = return_num // 10
    else:
        break
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def nzeros(n):
    last = n % 10
    rest = n // 10
    if last != 0:
        return 0
    else:
        return 1 + nzeros(rest)

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

input = input()
n = int(input)
print(nzeros(double_factorial(n)))

Submission status: Runtime Error

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

x = f(N)
out = 0
while True:
    if x % 5 == 0:
        x =/ 5
        out += 1
    else:
        break

print(out)

Submission status: Runtime Error

Solution code:
N = int(input())
a = str(N)[0]+"0"
if N%2==1:
  print(0)
else:
  if N >= 24:
    print(int(a)**(len(str(N))-1)+25*10**(len(str(N))-3)-5)
  else:
    print(int(a)**(len(str(N))-2))

Submission status: Runtime Error

Solution code:
n = int(input())
m = n
while m > 10:
    m = m // 10
    ans += m

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

print(ans)

Submission status: Runtime Error

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

if N%2 == 1:
    ans = 0
else:

    df = math.log10(N)
    d = math.floor(df)
    cnt = 0
    for i in range(d,0,-1):
        cnt += (N//10**i) * (10**i-1)//(10-1)
        N/=10**i

print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())
def f(n):
    if n<2:
        return 1
    else:
        return n*f(n-2)
chk = f(n)
ans = 0
for i in range(0, 10**20):
    if chk%10==0:
        ans+=1
        chk = chk/10
        chk = int(chk)
    else:
        break
print(ans)

Submission status: Runtime Error

Solution code:
def func(a):
    if a < 2:
        return 1
    else:
        return a*func(a)

num = input()

a = str(func(num))

count = 0
for i in reverse(range(a)):
	if a[i] == 0:
        count = 1 + count
    else:
        break
print(count)

Submission status: Runtime Error

Solution code:
if n%2 == 1:
    print(0)
else:
    n_half = n//2
    fives = n_half//5
    print(fives)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
def a(n):
  if n<2:
    return 1
  elif n>=2:
    return n*a(n-2)

  
n = int(input()) 
an = a(n)
flag=1
cnt=0
while flag:
  an,mod=divmod(an, 10)
  cnt+=1
  if mod is not 0:
    cnt-=1
    flag=0

print(cnt)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
if N < 2:
  Ans = 1
else:
  n = N % 2
  AB = [N]
  if n == 0:
    ni = N //2 -1
  else:
    ni = N //2
  for i in range(ni):
    ab = AB[-1] - 2
    AB.append(ab)
  Ans = str(np.prod(AB))
Ans = list(reversed(Ans))
ans = []
for i in range(len(Ans)):
  if Ans[i] == '0':
    ans.append(i)
  else:
    break
print(len(ans))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python

n_int = int(input())
n_str = str(n_int)
# print(n_int)
# print(len(n_str))

def num_to_keta(num):
    return(len(str(num)) - 1)

def g(n):
    if n == 10:
        return 1
    else:
        return num_to_keta(n) + g(n/10)

flag = False
if n_int < 10 or n_int % 2 != 0:
    flag = True

if flag:
    print(0)
else:
    n = num_to_keta(n_int) * 10
    print(g(n))

Submission status: Runtime Error

Solution code:
n=int(input())
def f1(a):
  if a<2:
    return 1
  return a*f1(a-2)
  
print(f1(n))

Submission status: Runtime Error

Solution code:
N = int(input())
def func(n):
    if(n<2):
        return 1
    return n * func(n-2)

ans = func(N)
count = 0
ansStr = str(ans)
for i in range(len(ansStr)-1,-1,-1):
    if(ansStr[i] == "0"):
        count += 1
    else:
      break

print(count)

Submission status: Runtime Error

Solution code:
def a(n):
  if n<2:
    return 1
  elif n>=2:
    return n*a(n-2)

  
n = int(input()) 
an = a(n)
flag=1
cnt=0
while flag:
  an,mod=divmod(an, 10)
  cnt+=1
  if mod>0:
    cnt-=1
    flag=0

print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())

def func(a):
  if a < 2:
    return 1
  return a * func(a-2)

count = 0

res = str(func(n))

print(res)

for i in range(-1, -len(res)-1, -1):
  if res[i] == '0':
    count+=1
  else:
    break
      
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())

if N%2 != 0:
  answer = 0
else:
  answer_2 = 0
  n = 1
  while (N/2)//(2**n) != 0:
    answer_2 += int((N/2)//(2**n))
    n += 1 
  answer_5 = 0
  m = 1
  while (N/2)//(5**m) != 0:
    answer_5 += int((N/2)//(5**m))
    m += 1 
answer = min(answer_2, answer_5)
print(answer)

Submission status: Runtime Error

Solution code:
def func_(n):
  if n < 2:
    return 1
  else:
    return n * func_(n-2)

N = int(input())
tmp = func_(N)

count = 0
while True:
  if tmp % 10 > 0:
    break
  else:
    tmp = tmp // 10
    count += 1
    
print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
def f1(N):
  if N<2:
    return 1
  return N*f1(N-2)
  
print(f1(n))

Submission status: Runtime Error

Solution code:
n = int(input())
def rec(n):
    res = n
    while n > 2:
        now = n-2
        res *= now
        n = now

    return res



if n < 2:
    print(1)
else:
    res = str(rec(n))
    print(res)
    count = res.count('0')
    num = 0
    for i in range(count):
        check = (i + 1) * (-1)
        if res[check] != '0':
            break
        num += 1

print(num)

Submission status: Runtime Error

Solution code:
import sys
A = 10**18
sys.setrecursionlimit(A)

N = int(input())

def f(n):
    '''
    if N % 2 == 1:
        n = (N+1)//2
        if n == 1:
            return 1
        else:
            return (2*n+1) * f(2*(n-1))
        
    else:
        n = N // 2
        if n == 1:
            return 1
        else:
            return 2 * n * f(2*(n-1))
    '''
    if n == 1:
        return 1
    else:
        return n * f(n-2)


count = 0
a = f(N)
print(a)

while(a % 10 ==0):
    a = a // 10
    count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = input()

L = len(N)
ans = 0
buf = "0"
p = L - 1

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

else:
        count = int(N) // 10
        for j in range(1, 50):
            count += int(N) // ((5**j) * 10)

print(count)

Submission status: Runtime Error

Solution code:
# coding:utf-8
import scipy

N = int(input())

if N < 2 or N % 2 != 0:
    print(0)
    exit(0)
else:
    if N < 10:
        print(0)
        exit(0)
    elif N < 19:
        print(1)
        exit(0)
    else:
        while 1:
            if N % 10 == 0:
                break
            else:
                N -= 2
        print(scipy.misc.factorial2(N, exact=True))
        exit(0)

Submission status: Runtime Error

Solution code:
def a(n):
  if n<2:
    return 1
  elif n>=2:
    return n*a(n-2)

n = int(input()) 
an = a(n)
flag=1
cnt=0
while flag:
  an,mod=divmod(an, 10)
  cnt+=1
  if mod>0:
    cnt-=1
    flag=0
print(cnt)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000000)

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

N = int(input())
X = f(N)
XL = list(str(X))
i = len(XL) - 1
ans = 0
while i > 0:
    if XL[i] == '0':
        ans += 1
        i -= 1
    else:
        break

print(ans)

if flag == 1 or L == 0:
    print(-1)
else:
    print(N-L)

Submission status: Runtime Error

Solution code:
n=int(input())
def f1(N):
  if N<2:
    return 1
  else:
    return N*f1(N-2)
  
print(f1(n))

Submission status: Runtime Error

Solution code:
def func_how_many_5(n):
    if n>3:
        if n%5==0:
            c=0
            temp=n
            while temp%5==0:
                c+=1
                temp //=5
            
            return c+func_how_many_5(n-2)
        else:
            return func_how_many_5(n-2)
    else:
        return 0


n=int(input())
if n%2==0:
    print(func_how_many_5(n))
else:
    print(0)

Submission status: Runtime Error

Solution code:
d = {0: 1, 1: 1}


def main():
    n = int(input())
    df(n//10)
    df(n//5)
    df(n//2)
    m = str(df(n))
    count = 0
    if m[-1] != '0':
        print(0)
    else:
        while (m[-1] == '0'):
            m = m[:-1]
            count += 1
        print(count)


def df(n):
    if n in d:
        return d[n]
    else:
        temp = n*df(n-2)
        d[n] = temp
        return temp

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())

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

logtenN = int(np.log10(n))


ans = 0
for i in range(1,logtenN+1):
    add10 = n//(10**i)
    ans += add10
    logfiveAddTen = int(np.log10(add10)/np.log10(5))
    for j in range(1,logfiveAddTen):
        add5 = (add10//(5**j))//2
        ans += add5

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
def F(n):
    if n < 2:
        return 1
    return n*F(n-2)
i = 0
f = F(n)
while f%2==0:
    f=f/2
    i += 1

j = 0
while f%5==0:
    f=f/5
    j += 1
print(min(i,j))

Submission status: Runtime Error

Solution code:
import numpy as np
num = int(input())
n = int(np.log10(num))
a =  n * (num // 10 ** n)
print(a)
for i in range(int(n - 2), 1, -1):
    a += i * 9
print(a)

Submission status: Runtime Error

Solution code:
N = int(input())

def double_function(N):
    if N >= 2:
        return N * double_function(N-2)
    else:
        return 1

ans = double_function(N)
#print(ans)

ans_str = list(str(ans))
#print(ans_str)
count = 0
for i in range(len(ans_str)-1,-1,-1):
    #print(i)
    if ans_str[i] == "0":
        count += 1
    else:
        break
print(count)

Submission status: Runtime Error

Solution code:
# 22:10
import sys
sys.setrecursionlimit(10 ** 7)
def f(n):
    if n < 2:
        return 1
    else:
        return n * f(n-2)

n = int(input())
ret = f(n)
ans = 0
for i in range(1,len(str(ret))):
    if str(ret)[-i] == "0":
        ans += 1
    else:
        print(ans)
        exit(0)

Submission status: Runtime Error

Solution code:
n=int(input())
def f1(N):
  if N<2:
    return 1
  else:
    return n*f1(N-2)
  
print(f1(n))

Submission status: Runtime Error

Solution code:
def func(n):
    if n < 2 :
        return 1
    else :
        return n*func(n-2)

def main():
    N = int(input())
    fn = func(N)
    count = 0
    while fn > 0:
        if fn%10 == 0:
            count += 1
        fn = int(fn/10)
    print(count)


main()

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

def memoize(f): #メモ化関数
    table = {}
    def func(*args):
        if not args in table:
            table[args] = f(*args)
        return table[args]
    return func
      
@memoize
def memf(n):
    if ( n<=1 ):
        return 1
    else:
        return n*f(n-2)
        
ans = memf(N)
# print(ans)
str_ans = str(ans)
count = 0
for s in reversed(str_ans):
    if s != '0':
        break
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
def f(n):
    if n<2:
        return 1
    else:
        return n*f(n-2)
x=f(n) ; y=0
for i in range(len(str(x))):
    if x%10**y==0:
        y+=1
    else:
        break
print(y-1)

Submission status: Runtime Error

Solution code:
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]
            n=int(n)
            count+=1
        else: n=int(n/5)
        #print("n="+str(n))
        summ+=n
    print(summ)
#12499999999999996
#1000000000000000000
#100000000000000010
# 99999999999999990

Submission status: Runtime Error

Solution code:
N = int(input())

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

@memoize
def memf(n):
    if ( n<=1 ):
        return 1
    else:
        return n*f(n-2)
        
ans = memf(N)
# print(ans)
str_ans = str(ans)
count = 0
for s in reversed(str_ans):
    if s != '0':
        break
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())

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

res = fac(n)
cz = 0
for i in str(res):

    if i == '0':
        cz += 1
    else:
        cz = 0
print(cz)

Submission status: Runtime Error

Solution code:
N = int(input())

if N%2:
    print(0)
else:
    t = N//10
    f = N//50
    
    ans = t+f+(N//200) - t//f
    print(ans)

Submission status: Runtime Error

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

# 5,2で10, 10で10
# nについて5のカウント数をa, 2のカウント数をbとすると，min(a,b)がカウント数となる
if not N%2==0:
    print(0)
else:
    count5 = 0
    max_5 = int(math.log(N,5))
    for i in range(1,max_5+1):
        count5+=int(int(N/(5**i))/2)
    count2 = 0
    max_2 = int(math.log(N,2))
    for i in range(1,max_2+1):
        count2+=int(int(N/(2**i)))
    print(min(count5,count2))

Submission status: Runtime Error

Solution code:
def func(n):
    if n < 2:
        return 1
    else:
        return n * func(n-2)
    
def main():
    N = int(input())

    ans = func(N)
    i = 0
    while 1:
        if ans % 10 == 0:
            i = i + 1
        else:
            break
    
    print(i)
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

n = int(input())
t = f(n)


i = 0
while t % 10 == 0:
    t = t // 10
    i += 1

print(i)

Submission status: Runtime Error

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

N = int(input())
X = f(N)
XL = list(str(X))
i = len(XL) - 1
ans = 0
while i > 0:
    if XL[i] == '0':
        ans += 1
        i -= 1
    else:
        break

print(ans)

Submission status: Runtime Error

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

out = 0

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

Submission status: Runtime Error

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

N = int(input())
if N%2==1:
    print(0)
    exit(1)
ans = 0
tmp = N//50//2
for i in range(1, len(str(N))):
    # if i != len(str(N))-1:
    #     ans+=(10**(i))
    ans += N//5//2
    N //= 10
print(ans+tmp)

Submission status: Runtime Error

Solution code:
import math
import sys

# print('input >>')
N = int(input())

if N % 2 == 1:
    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('-----output-----')
print(ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(5 * (10 ** 8))
n = int(input())

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


if n < 2:
    print(1)
else:
    res = str(saiki(n))
    count = res.count('0')
    num = 0
    for i in range(count):
        check = (i + 1) * (-1)
        if res[check] != '0':
            break
        num += 1

print(num)

Submission status: Runtime Error

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

a=list(str(f(int(input()))))
count=0
while True:
	if(a[-count-1]=="0"):
		count+=1
	else:
		break
print(count)

Submission status: Runtime Error

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

if 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)) )

Submission status: Runtime Error

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

n = int(input())
t = f(n)


i = 0
while t % 10 == 0:
    t = t / 10
    i += 1

print(i)

Submission status: Runtime Error

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

# 5,2で10, 10で10
# nについて5のカウント数をa, 2のカウント数をbとすると，min(a,b)がカウント数となる
if not N%2==0:
    print(0)
else:
    count = 0
    max_n = int(math.log(N,5))
    for i in range(1,max_n+1):
        count+=int(int(N/(5**i))/2)
    
    print(count)

Submission status: Runtime Error

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

N = int(input())
if N%2==1:
    print(0)
    exit(1)
ans = 0
for i in range(1, len(str(N))):
    # if i != len(str(N))-1:
    #     ans+=(10**(i))
    ans += N//5//2
    N //= 10
ans = list(str(ans))
ans2 = []
for i in range(len(ans)):
    i = int(i)
    if i==len(ans)-1:
        res = 0
    elif i==len(ans)-2:
        res = 1
    elif i==len(ans)-3:
        res = 3
    elif i==0:
        res = 4
    else:
        res = 8
    ans2.append(str(res+int(ans[i])))
ans2.reverse()
ans2 = int(''.join(ans2))
print(ans2)

Submission status: Runtime Error

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

n = int(input())
t = f(n)

print(f(n))
i = 0
while t % 10 == 0:
    t = t / 10
    i += 1

print(i)

Submission status: Runtime Error

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

print(f(int(input())))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(5 * (10 ** 17))
n = int(input())

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


if n < 2:
    print(1)
else:
    res = str(saiki(n))
    count = res.count('0')
    num = 0
    for i in range(count):
        check = (i + 1) * (-1)
        if res[check] != '0':
            break
        num += 1

print(num)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)


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

    return n * f(n-2)


N = int(input())
cal = f(N)

cnt = 0
for c in str(cal)[::-1]:
    if c == '0':
        cnt += 1
    else:
        break
print(cnt)

Submission status: Runtime Error

Solution code:
def f(x):
  if x > 1:
    return x * f(x - 2)
  else:
    return 1
  
import sys
n = int(input())
sys.setrecursionlimit(1000000000)

fx = f(n)
ans = 0
while True:
  if fx / 10 == fx // 10:
    fx = fx // 10
    ans += 1
  else:
    print(ans)
    break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())

def f(n):
  if n<2:
    return 1
  else:
    return n*f(n-2)
s=str(f(n))
d=0
for i in range(len(s)):
  if s[-1-i]=="0":
    d=d+1
  else:
    break
    
print(d)

Submission status: Runtime Error

Solution code:
import math

N_str = input()
N = int(N_str)
digit = int(math.log10(N))+1

digit = len(N_str)

memo = [0]*26
for i in range(26):
    memo[i] = 5**(i+1)

if N % 2 == 0:
    ans = 0
    for j in range(26):
        ans += (N//memo[j])//2
    print(ans)
else:
    print(0)

Submission status: Runtime Error

Solution code:
def main():
	n = int(input())
	# b = int(input())
	# a = list(map(int,input().split()))
	# A = [list(map(int, input().split())) for _ in range(n)]
	# print(a)
	ans = 0
	if n % 2 == 0:
		l = list(range(2,n+1))
		for i in l:
			if i % 10 == 0:
				ans += 1
		print(ans)
	else:
		print(0)





if __name__ == '__main__':
	main()

Submission status: Runtime Error

Solution code:
stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))  # applies to only numbers
rs = lambda: stdin.readline().rstrip()  # ignores trailing space

N = ri()

if N&1:
    print(0)
    exit()

answer = N // 10

while N >= 50:
    answer += (N // 50)
    N //= 50
print(answer)

Submission status: Runtime Error

Solution code:
import math


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

    if N % 2 == 0:
        B = N // 2
        n = math.floor(math.log(B) / math.log(5))

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

    else:
        ans = 0

    print(int(ans))


main()

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

N = int(input())

if N%2:
    print(0)
else:
    t = N//10
    f = N//50
    
    ans = t+f+(N//200) - t//f
    print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

def func(n_):
    if n_ < 2:
        return 1
    else:
        return func(n_-2)*n_
c = 0
for i in list(str(func(n)))[::-1]:
    if i == "0":
        c += 1
    else:
        break
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())

def f(n):
  if n<2:
    return 1
  else:
    return n*f(n-2)
s=str(f(n))
d=0
print(s)
for i in range(len(s)):
  if s[-1-i]=="0":
    d=d+1
  else:
    break
    
print(d)

Submission status: Runtime Error

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

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

num = str(fact(n))

for i in range(len(num)):
  if num[-1-i] == '0':
    ans += 1
  else:
    break
  
print(ans)

Submission status: Runtime Error

Solution code:
from math import factorial, log, floor
N = int(input())

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

Submission status: Runtime Error

Solution code:

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int res = factorial(n);
        String str = Integer.toString(res);
        StringBuilder rev = new StringBuilder(str);
        String s = rev.reverse().toString();
        String[] st = s.split("");
        int count = 0;
        for (int i=0; i<st.length; i++){
            if (st[i].contains("0")) {
                count += 1;
            } else {
                break;
            }
        }
        System.out.println(count);

    }

    public static int factorial(int a){
        return (a<2)?1:a*factorial(a-2);
    }
}

Submission status: Runtime Error

Solution code:
from math import log10

N = int(input())
if N % 2:
    print(0)
    sys.exit()
    
ans = 0
k = int(log10(N))


for i in range(k-1):
    ans += (k-i-1)* 9 ** (i+1)
n = N - 10**k

print(ans + k * (n // 10 + 1))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

N = int(input())

if N%2:
    print(0)
else:

    ans = (N//10) + (N//50)+ (N//200) - ((N//10)//(N//50))
    print(ans)

Submission status: Runtime Error

Solution code:
def repeat(x):
    if x < 2:
        return 1
    else:
        return x * repeat(x - 2)

n = int(input())
total = repeat(n)
tmp = str(total)
moji = len(tmp)
count = 0

while moji > 0:
    if tmp[moji-1] == '0':
        count += 1
    else:
        break
    moji -= 1

print(count)

Submission status: Runtime Error

Solution code:
def f(x):
  if x > 1:
    return x * f(x - 2)
  else:
    return 1
  
import sys
n = int(input())
sys.setrecursionlimit(9999999999)

fx = f(n)
ans = 0
while True:
  if fx / 10 == fx // 10:
    fx = fx // 10
    ans += 1
  else:
    print(ans)
    break

Submission status: Runtime Error

Solution code:
# ABC148 E
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
import math
n=ni()

if n==0:
    print(0)

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

five=math.floor(math.log(n,5))
ans=0

# for i in range(five):
for j in range(five):
    t=n//(5**(five-j))
    ans+=t//2
print(ans)

Submission status: Runtime Error

Solution code:
new_str, num, string = "", int(input()), input().split(" ")
for x in range(0, num):
    new_str += string[0][x] + string[1][x]
print(new_str)

Submission status: Runtime Error

Solution code:

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int res = factorial(n);
        String str = Integer.toString(res);
        StringBuilder rev = new StringBuilder(str);
        String s = rev.reverse().toString();
        String[] st = s.split("");
        int count = 0;
        for (int i=0; i<st.length; i++){
            if (st[i].contains("0")) {
                count += 1;
            } else {
                break;
            }
        }
        System.out.println(s);
        System.out.println(count);

    }

    public static int factorial(int a){
        int res = 0;
        if (a<2) {
            res = 1;
        } else {
            res = a*factorial(a-2);
        }
        return res;
    }
}

Submission status: Runtime Error

Solution code:
import math
  
n=int(input())
if n%2 == 0:
  k = n%10
  t = n-k
  ans = 0
while t%5 == 0:
  s = t//5
  ans += s
  t = s
print(ans//2)
if n%2 == 1:
  print(0)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
signed main(){
 	int n; cin>>n;
  	if(n%2)
      cout<<0;
  	else{
      n /= 2;
    	if(n==0)
          cout<<1;
      	else{
        	int k = 5;
          int ans =0;
          while(n/k > 0){
          	ans += n/k;
            k *= 5ll;
          }
          cout<<ans;
        }
    }
  	return 0;
}

Submission status: Runtime Error

Solution code:
# ABC148 E
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
import math
n=ni()

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

five=math.floor(math.log(n,5))
ans=0

# for i in range(five):
for j in range(five):
    t=n//(5**(five-j))
    ans+=t//2
print(ans)

Submission status: Runtime Error

Solution code:
from math import log10

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