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

hoge = []

if N % 2 != 0:
    purint(0)
else:
    for i in range(1, 19):
        hoge.append(N // 10**i)
    print(sum(hoge))

Submission status: Runtime Error

Solution code:
n = int(input())
if n mod 2 == 0 or n < 10:
    print(0)
else:
    k = n // 5
    print(k * (k + 1) / 2)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
if N % 2 == 1:
    print(0)
else:
    div10 = N // 10
    sum_val = div10
    count_5 = math.floor(math.log(div10, 5))
    for i in range(count_5):
        sum_val += div10 // pow(5, i + 1)
    print(sum_val)

Submission status: Runtime Error

Solution code:
include Math
N = gets.to_i
if N % 2 == 1
  puts 0
else
  order = Math.log(N, 5)
  # puts order
  ans = 0
  (1..order).each do |i|
    ans += N.div(5**i)/2
    #print i.to_s + " "
    #puts ans
  end
  puts ans
end

Submission status: Runtime Error

Solution code:
import math

N = int(input())

rep = int(math.floor(math.log(N,5)))
r=0
for i in range(rep):
  q = 5**(i+1)
  if (N//q)%2==0:
    w = (N//q)//2
  else :
    w = ((N-1)//q)//2
  r+=w

if N%2==1:
  r=0

print(r)

Submission status: Runtime Error

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

N = int(input())
result = str(f(N))[::-1]
print(result)

count = 0
for n in result:
    if n != 0:
        break
    else:
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
import math

N = int(input())

rep = int(math.floor(math.log(N,5)))
r=0
for i in range(rep):
  q = 5**(i+1)
  w = ((N//q)+1)//2
  r+=w

if N%2==1:
  r=0

print(r)

Submission status: Runtime Error

Solution code:
N = int(input())

count = 0
div = 10

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

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if n%2==0:
	list=[i for i in range(n+1) if i%2==0]
    s=reduce(labmda x,y:x*y,list)
  	for j in len(s):
    	if s(len(s)-j-1)==0:
      		cnt+=1
    	else:
      		break
  			print(cnt)
else:
  print(0)

Submission status: Runtime Error

Solution code:
n=int(input())
s=1
cnt=0
if n%2==0:
  for i in (n/2+1):
    s=s*2*i
  	for j in len(s):
    	if s(len(s)-j-1)==0:
      		cnt+=1
    	else:
      		break
  			print(cnt)
else:
  print(0)

Submission status: Runtime Error

Solution code:
n=int(input())
s=1
if n%2==0:
  for i in (n/2+1):
    s=s*2*i
  	cnt=0
  	for j in len(s):
    	if s(len(s)-j-1)==0:
      		cnt+=1
    	else:
      		break
  			print(cnt)
else:
  print(0)

Submission status: Runtime Error

Solution code:
n=int(input())
s=1
if n%2==0:
  for i in (n/2+1):
    s=s*2*i
  	cnt=0
  	for j in len(s):
    	if s(len(s)-j-1)==0:
      		cnt+=1
    	else:
      		break
  print(cnt)
else:
  print(0)

Submission status: Runtime Error

Solution code:
n=int(input())
s=1
if n%2==0:
  for i in (n/2+1):
    s=s*2*i
  cnt=0
  for j in len(s):
    if s(len(s)-j-1)==0:
      cnt+=1
    else:
      break
  print(cnt)
else:
  print(0)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

N = int(input())

if N%2 != 0 : 
    print(0)
    
else : 
    n = 1
    while 2*(5**n) <= N : 
        n += 1
        
    global_cnt = 0
    
    for i in range(1, n) : 
        local_cnt = N // (2*(5**i))
        global_cnt += local_cnt
        
print(global_cnt)

Submission status: Runtime Error

Solution code:
import math


def run(N):
    ans = 0
    if N % 2 == 0:
        for i in range(int(math.log(N, 5))):
            ans += N // (10 * (5**i))
    return ans


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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
if N < 2:
    F = 1
    print(0)
elif N % 2 == 1:
    print(0)
else:
    t = 10
    result = 0
    while t <= N:
        result += N // t
        t = t * 5
print(result)

Submission status: Runtime Error

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

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

a=f(n)
while a%10==0:
    a=a/10
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
#n = 12
n = int(input())
def f(x):
    if x < 2: return 1
    return x * f(x - 2)
r = f(n)
r = str(r)
l = len(r)
i = l
#print(r)
while True:
    if r[i-1] != "0" or i==-1: break
    i -= 1
r = l - i
print(r)

Submission status: Runtime Error

Solution code:
#n = 12
n = int(input())
def f(x):
    if x < 2: return 1
    return x * f(x - 2)
r = f(n)
r = str(r)
l = len(r)
i = l
#print(r)
while True:
    if r[i-1] != "0": break
    i -= 1
r = l - i
print(r)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def w(n):

  if n < 2:
    return 1

  else:
    return n * w(n-2)


def v(n,t):

  if (n % 10 == 0):
    return 1 + v(int(n / 10),t)
  else:
    return t

n = int(input())
a = w(n)
b = v(a,0)
print(b)

Submission status: Runtime Error

Solution code:
N = int(input())

cnt =0

if N ==0:
    print(cnt)
elif N % 2 ==0:
    p = N//2
    num=1
    for i in range(1,p+1):
        num = num*2*i
else:
    p = (N+1)//2
    num=1
    for i in range(1,p+1):
        num = num*(2*i-1)     
length = len(str(num))
for s in reversed(str(num)):
    if int(s) ==0:
        cnt+=1
    else:
        break 
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
if N ==0:
    print(cnt)
elif N % 2 ==0:
    p = N//2
    for i in range(1,p+1):
        num = num*2*i
    length = len(str(num))
    print(num%10)
    
    while num%10 ==0:
        print(num)
        if num%10 !=0:
            break
        else:
            cnt +=1
            num = num//10
            
    print('cnt1:',cnt)

else:
    p = (N+1)//2
    for i in range(1,p+1):
        num = num*(2*i-1)
    length = len(str(num))
    while num%10 ==0:
        if num%10 !=0:
            break
        else:
            num = num//10
            cnt +=1
    print('cnt2:',cnt)

Submission status: Runtime Error

Solution code:
N = int(input())

num=1
if N==0:
  print(num)
elif N % 2 ==0:
    p = N//2
    for i in range(1,p+1):
        num = num*2*i
    cnt =0
    for s in len(str(num)):
      if int(s) !=0:
        print(cnt)
        break
      else:
        cnt +=1
    print(cnt)
else:
    p = (N+1)//2
    for i in range(1,p+1):
        num = num*(2*i-1)
    cnt =0
    for s in len(str(num)):
      if int(s) !=0:
        print(cnt)
        break
      else:
        cnt +=1
    print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
n = int(input())

def factorial(n):
    if n <= 0:
       return 1
    else:
       return n*factorial(n-2)

sum = factorial(n)

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

print(count)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
if(N == 0):
  print(0):
    
elif(N%2 == 1):
  print(0)

else:
  tmp10 = int(math.log10(N))
  # print(tmp10)
  Num5 = 0
  cur = N
  for i in range(tmp10+1):
    cur = cur//10
    Num5 +=  cur
    
  print(Num5)

Submission status: Runtime Error

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

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

else:
  tmp10 = int(math.log10(N-2))
  # print(tmp10)
  Num5 = 0
  cur = N
  for i in range(tmp10+1):
    cur = cur//10
    Num5 +=  cur
    
  print(Num5)

Submission status: Runtime Error

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

ans = 101

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

Submission status: Runtime Error

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

ans = 0

for i in range(int(math.log(N,5))):
    ans += N//(5**(i+1)*2)
print(ans)

Submission status: Runtime Error

Solution code:
import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

N = int(input())

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

print(sum([N//(2*5**i) for i in range(1, 50)]))

import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

N = int(input())

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

print(sum([N//(2*5**i) for i in range(1, 50)]))

Submission status: Runtime Error

Solution code:
import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

N = int(input())

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

v = math.floor(math.log(N, 5))

print(sum([N//(2*5**i) for i in range(1, v+1)]))

Submission status: Runtime Error

Solution code:
import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)

N = int(input())


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

v = math.log(N, 5)

l = [i for i in range(1, math.floor(v+1))]
ll = [2*5**i for i in l]
lll = [N//i for i in ll]
print(sum(lll))

Submission status: Runtime Error

Solution code:
import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

N = int(input())


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

v = math.log(N, 5)

l = [i for i in range(1, math.floor(v+1))]
ll = [2*5**i for i in l]
lll = [N//i for i in ll]
print(sum(lll))

Submission status: Runtime Error

Solution code:
import sys

N = int(input())

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

ans = compute(N)

count = 0
while True:
  if ans % 10 == 0:
    ans /= 10
    count += 1
  else:
    print(count)
    sys.exit()

Submission status: Runtime Error

Solution code:
N = int(input())

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

ans = function(N)

count = 0
while True:
  if ans % 10 == 0:
    ans /= 10
    count += 1
  else:
    print(count)
    sys.exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n = N
num_zero = 0
if (N % 2) == 1:
  print(0)
else:
  max10 = math.floor(math.log10(N))
  while max10 > 0:
    num_zero_temp = int("1"*max10)
    num_zero_temp *= n // (10**max10)
    num_zero += num_zero_temp
    n = n % (10**max10)
    if n == 0:
      break
    else:
      max10 = math.floor(math.log10(n))
  print(num_zero)

Submission status: Runtime Error

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

n = N
num_zero = 0
if (N % 2) == 1:
  print(0)
else:
  max10 = math.floor(math.log10(N))
  while max10 > 0:
    num_zero_temp = int("1"*max10)
    num_zero_temp *= n // (10**max10)
    num_zero += num_zero_temp
    n = n % (10**max10)
    if n == 0:
      break
    else:
      max10 = math.floor(math.log10(n))

print(num_zero)

Submission status: Runtime Error

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

n = N
num_zero = 0
if (N % 2) == 1:
  print(0)
else:
  max10 = math.floor(math.log10(N))
  while max10 > 0:
    num_zero_temp = int("1"*max10)
    num_zero_temp *= n // (10**max10)
    num_zero += num_zero_temp
    n = n % (10**max10)
    max10 = math.floor(math.log10(n))

print(num_zero)

Submission status: Runtime Error

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

n = N
num_zero = 0
if (N % 2) == 1:
  print(0)
else:
  max10 = math.floor(math.log10(N))
  while n > 9:
    num_zero_temp = int("1"*max10)
    num_zero_temp *= n // 10**max10
    num_zero += num_zero_temp
    n = n % (10**max10)
    max10 -= 1

print(num_zero)

Submission status: Runtime Error

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

if (N % 2) == 1:
  print(0)
else:
  max10 = math.floor(math.log10(N))
  print(sum([i for i in range(1, max10+1)]))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 26 15:06:07 2019

@author: Shunya
"""
"""
func2は5の倍数が何個あるか数える
"""
import sys
sys.setrecursionlimit(10000)
def func2(input1):
    count=0
    flag = 0
    while flag == 0:
        if input1%5==0:
            count=count+1
            input1=int(input1/5)
        else:
            flag=1
        return count
"""
funcは再帰関数
"""
def func (a,ans):
    ans=ans+func2(a)
    b=a-2
    if b<2:
        return ans
    return func(b,ans) 
"""
main文
"""
inputbox=int(input())
if inputbox % 2 ==0:
    print(func(inputbox,0))
else:
    print("0")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 26 15:06:07 2019

@author: Shunya
"""
"""
func2は5の倍数が何個あるか数える
"""
def func2(input1):
    count=0
    flag = 0
    while flag == 0:
        if input1%5==0:
            count=count+1
            input1=input1/5
        else:
            flag=1
        return count
"""
funcは再帰関数
"""
def func (a,ans):
    ans=ans+func2(a)
    b=a-2
    if b<2:
        return ans
    return func(b,ans) 
"""
main文
"""
inputbox=int(input())
if inputbox % 2 ==0:
    print(func(inputbox,1))
else:
    print("0")

Submission status: Runtime Error

Solution code:
from sys import exit
N = int(input())

a = 0
b = 0
result = 0
if N % 2 == 1:
  print(0)
  exit()
for i in range(N, 0, -2):
  if i % 2 == 0:
    a += 1
  if i % 5 == :
    b += 1
  if a > 0 and b > 0:
    result += 1
    a, b = 0, 0
print(result)

Submission status: Runtime Error

Solution code:
import math
def solve(n):
    n/=2
    a=0
    while n>=5:
        a+=math.floor(n/5)
        n=math.floor(n/5)
    print(a)
    return 0

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

Submission status: Runtime Error

Solution code:
N = int(input())
if N%2:
  print("0")
else:
  ans = 0
  i = 1
  while True:
    ans += N // (10*i)
    i *= 5
    if i > N:break
      
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
b=0

def f(N):
	if N<2:
		return 1
	if N>=2:
		return N*f(N-2)
X=f(N)
print(X)
if X%2==0:
	while X%5==0:
		X=X/5
		b=b+1
      
print(b)

Submission status: Runtime Error

Solution code:

N = int(input())

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

res = func(N)

ans = 0
while True:
    if res % 10 == 0:
        ans += 1
        res = res//10
    else:
        break
print(ans)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
ans=0
if n%2==1:
    print(ans)
else:
    m=math.ceil(math.log(n, 5))
    for i in range(1, m):
        ans +=(n//2)//(5**i)
    print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())

if n%2==1:
    print(0)
    exit(0)
def findTrailingZeros(n):
    # Initialize result
    count = 0

    i = 10

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

    return count
get5s=findTrailingZeros(n)
print(get5s)

Submission status: Runtime Error

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

n = int(input())
ans = fx(n)
ans_str = str(ans)
output = 0
a = 1
for i in range(len(ans_str)-1):
    a= ans %10
    if(a == 0):
        output += 1
    ans = ans/10
print(output)

Submission status: Runtime Error

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


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

def k_change():
    global k
    k = k*5


def func(n):
    global ans,k
    #print(k)
    if n < k:
        print(ans)
        exit()
    ans += n//k
    k_change()
    func(n)

func(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
#再起で作ってみる
n = int(input())
ans=0
if n%2 !=0:
  print(0)
  exit()

def duo_fac(x):
  if x>3:
    return x*duo_fac(x-2)
  else:
    return x
  
val = duo_fac(n)

while val%5 == 0:
  ans+=1
  val = val/5
  
print(ans)

Submission status: Runtime Error

Solution code:
#再起で作ってみる
n = int(input())
ans=0
if n%2 !=0:
  print(0)
  exit()

def duo_fac(x):
  if x>3:
  	return x*duo_fac(x-2)
  else:
    return x
  
val = duo_fac(n)

while val%5 == 0:
  ans+=1
  val = val/5
  
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=input()
M=int(N)
f=1
while 2<=M:
  if M<2:M=1
  f *= M
  M -= 2

A=len(f)-len(f.rstrip('0'))
print(A)

Submission status: Runtime Error

Solution code:
N = int(input())

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

ans = 0
if N % 2 = 1:
  ans = 0
else:
  divisors_list = make_divisors(N)
  from collections import defaultdict as ddict
  divisors_dict = ddict(int)
  for divisor in divisors_list:
    divisors_dict[diivisor] += 1
  ans = diviisors_dict[5]

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 2 != 0:
  print(0)
else:
  while n:
    ans += n
  print(n)

Submission status: Runtime Error

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

if n%2 == 1:
	print(0)
else:
	k = math.floor(math.log(n)/math.log(5))
	div = 5
	total = 0
	for i in range(k):
		total += math.floor(n/(2*div))
		div *= 5
	print(total)

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 2:
    print(0)
else:
    ans, x = 0, 5
    while(x <= n):
        ans += ((n // x) // 2)
        x *= 5
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
try:
  n = int(input())

  if n %2 ==1:
    print(0)
  else:
    mod = 10
    ans = n//mod
    x = n//mod
    while(x>0):
      mod *= 5
      x = n//mod
      ans+=x
print(ans)
except Exception as e:
  print(e)

Submission status: Runtime Error

Solution code:
n = int(input())

if n %2 ==1:
  print(0)
else:
  mod = 10
  ans = n//mod
  x = n//mod
  loop = 0
  while(x>0 and loop<10**7):
    loop += 1
    mod *= 5
    x = n//mod
    ans+=x
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 2 == 1:
  print(0)
elif n == 0:
  print(1)
else:
  m = n // 2
  l = 1
  ans = 0
  while 5**l <= m:
    ans += m//(5**l)
    l += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
#sys.setrecursionlimit(10**9)

n = int(input())

def nfn(n):
    if n < 2:
        return 1
    res = n*int(nfn(n-2))
    return res

s = str(nfn(n))
cnt = 0

for i in s[::-1]:
    if i == '0':
        cnt+=1
    else:
        break
print(cnt)

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:
import numpy as np
N = int(input())
n2 = N % 2
if n2 != 0:
  ans = 0
else:
  F = list(range(2, N+1, 2))
  a5 = int(np.log(N) // np.log(5))
  B = []
  for i in range(a5):
    a=2 * (5 ** (i+1))
    b = [f for f in F if f % a == 0]
    B.append(len(b))
  ans = np.sum(B)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())


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

ans = f(n)

ind = str(ans).rfind("0")
if(ind == -1):
  print(0)
else:
  print(len(str(ans)) - ind)

Submission status: Runtime Error

Solution code:
n = int(input())


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

ans = f(n)

ind = str(ans).rfind("0")
if(ind == -1):
  print(0)
else:
  print(len(str(ans) - ind))

Submission status: Runtime Error

Solution code:
N = int(input())

def factorial(n, p):
    if n == 0: return 1
    return n/p + factorial(n/p, p)

def duble_factorial(n, p):
    if n%2 == 1:
        return factorial(n,p) - duble_factorial(n-1, p) # n!! = n!/(n-1)!!だからpで割ると引き算で表せるよね
    else:
        res = factorial(n/2, p)
        if p == 2: 
            res += n/2
        return res

ans = min(duble_factorial(N,2), duble_factorial(N,5))
print(ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000000) 

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

n = int(input())
F_s = str(f(n))
ans = 0

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

Submission status: Runtime Error

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

n = int(input())
F_s = str(f(n))
ans = 0

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

Submission status: Runtime Error

Solution code:
def nf(N):
	if N < 2:
		return 1
	return N * nf(N-2)
 

def zeroNum(NUM):
	count = 0
	strNUM = str(NUM)
	for i in reversed(range(0, len(strNUM), 1)):
		if(strNUM[i] == '0'):
			count += 1
		else:
			return count


if __name__ == '__main__':
	N = int(input())
	NFN = nf(N)
	print(zeroNum(NFN))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math
import datetime
import itertools
import sys
import copy

# 入力
#N = int(input())
#S = str(input())
#N, A, B = map(int, input().split())
N = int(input())

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

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
n = N % 2
if n == 1:
  ans = 0
else:
  AB = list(range(N, 1, -2))
  a = int(np.log(N) / np.log(5))
  ab = []
  for i in range(a):
    a5 = 2 * 5 ** (i + 1)
    for Ab in AB:
      if Ab % a5 == 0:
        ab.append(Ab)
  ans = np.sum(ab)
print(ans)

Submission status: Runtime Error

Solution code:
N = int( input() )

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

import math    
ct = 0

M = N // 2
for i in range( math.ceil( math.log(M, 5) ) ) :
   if M >= 5**(i+1) :
      ct += M // ( 5**(i+1) )

print(ct)

Submission status: Runtime Error

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

def fact(n, x, ans):
    if x > n:
        return ans
    else:
        ans += math.floor(n/(2*x))
        return fact(n, x*5, ans)

if n < 2:
    print(1)
elif n%2:
    print(0)
else:
    print(fact5(n, 5, 0))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
n = N % 2
if n == 1:
  ans = 0
else:
  AB = list(range(N, 1, -2))
  AB = [ab for ab in AB if ab % 10 == 0]
  AB = [np.log10(ab) for ab in AB]
  AB = [int(ab) for ab in AB]
  ans = np.sum(AB)
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
n = N % 2
if n == 1:
  ans = 0
else:
  AB = list(range(N, 1, -2))
  AB = [len(str(ab)) - 1 for ab in AB if ab % 10 ==0]
  ans = np.sum(AB)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
n = N % 2
if n == 1:
  ans = 0
else:
  AB = [N]
  for i in range(N // 2 -1):
    ab = AB[-1] - 2
    AB.append(ab)
  AB = [int(np.log10(ab)) for ab in AB if ab % 10 ==0]
  ans = np.sum(AB)
print(ans)

Submission status: Runtime Error

Solution code:
if n % 2 == 1:
    print(0)
else:
    cnt = 0
    a = n // 2 // 5
    b = 0
    while a >= 5 ** b:
        cnt += a // 5**b
        b += 1
    print(cnt)

Submission status: Runtime Error

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

ct = 0
if N % 2 == 1 :
   print(0) 
else :
   for i in range( math.ceil( math.log10(N) ) ) :
       if N >= 10**(i+1) :
#          print( N // ( 10**(i+1) ) ) 
          ct += N // ( 10**(i+1) )

print(ct)

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)
    #print(min(count5,count2))
    count5 = 0 
    d = 5*2
    while int(N/d)>0:
        count5+=int(N/d)
        d = d*5

    print(count5)

Submission status: Runtime Error

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

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

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

print(cnt)

Submission status: Runtime Error

Solution code:
n=int(input())
a=0
for i in range(n):
  if n%10==0:
    break
  if n%2==1:
    a=-1
    break
  n=n-2
if a<0:
  print(0)
else:
  for i in range(n/10):
    a=i+a
  print(a)

Submission status: Runtime Error

Solution code:
n=int(input())
a=0
for i in range(n):
  if n%10==0:
    break
  if n%2==1:
    a=-1
    break
  n=n-2
if a<0:
  print(0)
else:
  for i in range((n/10)+1):
    a=i+a
  print(a)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**9)

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

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

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

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

    return arr

n=int(input())
P=factorization(myfunc(n))
ans=10**9
flg=0
for p in P:
  if p[0]==2 or p[0]==5:
    ans=min(ans,p[1])
    flg+=1
print(ans if flg==2 else 0)

Submission status: Runtime Error

Solution code:
n=int(input())
a=0
for i in range(n):
  if n%10==0:
    break
  if n%2==1:
    a=-1
    break
  n=n-2
if a<0:
  print(0)
else:
  for i in range(n/10+1):
    a=i+a
  print(a)

Submission status: Runtime Error

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

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

total = 0

for i in range(1, 2+int(math.log(N, 5))):
  t = 5 ** i * 2
  total += N // t

print(total)

Submission status: Runtime Error

Solution code:
N = int(input())
def f(n):
    if n < 2: return 1
    return n * f(n-2)
x = f(N)
rx = list(str(x))[::-1]
c = 0
for i in rx:
    if i == "0":
        c += 1
    else:
        break
print(c)

Submission status: Runtime Error

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