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: Wrong Answer

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

def check_ten(N):
    count = 0
    i = 10
    exp = 1
    while True:
        divided = N // i
        if divided == 0:
            break
        count += divided
        exp += 1
        i = i ** exp
    #print("check_ten", count)
    return count
        
def check_five(N):
    count = 0
    i = 5
    exp = 1
    while True:
        divided = N // i
        if divided == 0:
            break
        count += divided
        exp += 1
        i = i ** exp
    #print("check_five", count)
    return count

if N % 2 == 0:
    ans = check_ten(N)
else:
    ans = 0

if N < 9:
    ans = 0

print(ans)
# if N % 2 == 1:
#     multiply_list = [(2*i - 1) for i in range(1, int(N/2)+2)]
# else:
#     multiply_list = [(2*i) for i in range(1, int(N/2)+1)]

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = 0
while n > 0:
  n//=5
  cnt+=n
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
N=1000000000000000000

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

#s=0
#for i in range(2,N+1,2):
#    while(i%5==0 and i!=0):
#        s+=1
#        i=i//5
#print(s)

s=0
t=10
while(N>=t):
    s+=(N//t)
    t*=5
print(s)

#L=len(str(N))-1
#s+=L*(L-1)
#T=N//10
#s+=T
#print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

if N%2==1:
    print(0)
    exit()
else:
    ans=0
    m=10
    i=1
    while N>m:
        ans+=N//m
        i+=1
        m=2*5**i

print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
 
if n % 2 != 0:
    print(0)
else:
    ans=0
    m=10
    i=1
    while n >= m:
        ans+=math.floor(n/m)
        i+=1
        m=2*5**i
    print(ans)

Submission status: Wrong Answer

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

if n % 2 != 0:
    print(0)
else:
    ans=0
    m=10
    i=1
    while n >= m:
        ans+=math.floor(n/m)
        i+=1
        m=2*5**i
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 10
cnt = 0
if N % 2 == 0:
    # N is even.
    while a < N:
        cnt += (N // a)
        a *= 5
    print(cnt)
else:
    # N is odd.
    print(0)

Submission status: Wrong Answer

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

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

ans=0
m=10
i=1
while n >= m:
    ans+=math.floor(n/m)
    i+=1
    m=2*5**i
print(ans)

Submission status: Wrong Answer

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

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

ans=0
m=10
i=1
while n >= m:
    ans+=math.floor(n/m)
    i+=1
    m=2*5**i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())

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

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

Submission status: Wrong Answer

Solution code:
import sys

import numpy as np

N = int(input())

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

a = N // 2

print(a)

if a < 6:
    print(0)
    sys.exit()

a -= 6

print(a)
print(a // 5)

print(1 + a // 5)

for v in range(10, N, 10):
    print(v)

Submission status: Wrong Answer

Solution code:
n = int(input())

p = 5
tmp = 0
n //= 2

while n > 1:
    tmp += n // p
    n = n // p

if n % 2 == 0:
    print(tmp)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

def func(n):
    if n % 2 != 0:
        return 0

    n_half = n//2
    print(n_half)
    count = 0

    i = 1
    while 5**i <= n_half:
        count += n_half // 5**i
        i += 1

    return count


print(func(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def func(n):
    if n % 2 != 0:
        return 0

    n_half = n//2
    count = 0

    i = 1
    while 5**i < n_half:
        count += n_half // 5**i
        i+= 1

    return count


print(func(n))

Submission status: Wrong Answer

Solution code:
N = int(input())
nums=[]
if N%2!=0:
    print(0)
else:
    for i in range(N+1):
        if i ==0:
            nums.append(1)
        elif i % 2 ==0:
             nums.append(i)
n =1
for num in nums:
    print(num)
    n = n*num
    
cnt=0
for i in range(len(str(n))-1,-1,-1):
    if str(n)[i] =='0':
        cnt+=1
    else:
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
n2 = N % 2
if n2 != 0:
  ans = 0
elif N < 2:
  ans =0
else:
  a = int(np.log(N) // np.log(5))
  A = [N // (2 * (5 ** (i + 1))) for i in range(a)]
  ans = np.sum(A)
print(ans)

Submission status: Wrong Answer

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

n = int(input())

def func(n): #can't use it because of recursion limited in this problem
    if n == 0 or n == 1:
        return(1)
    else:
        return (n * func(n - 2)) 

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

Submission status: Wrong Answer

Solution code:
n = int(input())
p = 1
count = 0
while (2*5**p <= n):
    count += n//(2*5**p)
    p+=1
print(count)

Submission status: Wrong Answer

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

n = int(input())

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

Submission status: Wrong Answer

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

if n%2:
    print(0)
else:
    print(fact(n, 5, 0))

Submission status: Wrong Answer

Solution code:
a=(input())
alen=len(a)
a=int(a)
c=0
s=10





while(s<a):
    c+=a//s
    s*=5

    
print(c)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n % 2 == 1:
    print(0)
else:
    divide = 5
    ct = 1
    ans = 0
    n = n//2
    while divide < n:
        ans += n // divide
        divide *= 5
        ct += 1
        
        
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=(input())
alen=len(a)
a=int(a)
c=0
s=10





for i in range(1,alen+1):
    
    if a<s:
        break
    else:
        c+=a//s
        s*=5

    
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
i = 0
while True:
    x = (2 * 5 * (5 ** i))
    if x > N:
        break
    ans += N // x
    i += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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(0)
else:
    print(fact(n, 5, 0))

Submission status: Wrong Answer

Solution code:
N = int(input())
bo = 10
ans = 0
while bo < N:
    ans += N // bo
    bo *= 5
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

print(ans)

Submission status: Wrong Answer

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 == 0:
    print(1)
elif n%2:
    print(0)
else:
    print(fact(n, 5, 0))

Submission status: Wrong Answer

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(fact(n, 5, 0))

Submission status: Wrong Answer

Solution code:
import math


N = int(input())

# 奇数の場合0が登場することはない
if N & 1:
    print(0)
else:
    num = N / 2
    ans = 0
    while num != 0:
        num = num // 5
        ans += math.ceil(num)
    print(ans)

Submission status: Wrong Answer

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


N = int(input())

# 奇数の場合0が登場することはない
if N & 1:
    print(0)
else:
    num = N / 2
    ans = 0
    while num != 0:
        num /= 5
        ans += int(num)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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/((5**k)*2))
    	i += 1
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

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/((5**i)*2))
    	i += 1
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
  print(0)
else:
  now=1
  ans=0
  while 1:
    if n%(10**now)!=0:
      break
    else:
      ans+=n%(10**now)
      now+=1
  print(ans)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
def counter(n):
    point = 0
    s = str(n)
    keta = len(s)
    if keta == 1:
        return 0
    else:
        i = 1
        while True:
            point += n//(2*5**i)
            i += 1
            if n//(2*5**i) == 0:
                break
        return point
print(counter(n))

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())

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

count = 0
for i in range(1,len(str(n))):

    count += n // 10**i

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
x = 10
ans = 0
while x <= N:
    ans += N // x
    x *= 5

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
x = 10
ans = 0
while x < N:
    ans += N // x
    x *= 5

print(ans)

Submission status: Wrong Answer

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

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

if n//2:
    print(0)
else:
    print(fact(n, 5, 0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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(0)
else:
    print(fact(n, 5, 0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# abc148_e.py
from sys import stdin
def f(n):
	sum = 1
	while n >= 2:
		sum = sum * n
		n = n - 2
	return sum
N = int(stdin.readline().rstrip())
sum = f(N)
print(sum)
l = [int(x) for x in list(str(sum))]
l.reverse();
cnt = 0
for i in l:
	if i == 0:
		cnt = cnt + 1
	else:
		break
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
if N % 2 == 0:
	for i in range(0,100000):
		if N >= (10*(5**i)):
			#print((N//(10*(5**i)))*(i+1))
			count += (N//(10*(5**i)))*(i+1)
		else:
			break;
	print(count)
else:
	print(0)

Submission status: Wrong Answer

Solution code:
n=int(input())
w=5
ans=0
while w<n:
  ans+=n/w
  w=w*5
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n<=3:
    print(1)
elif n%2==1:
    print(0)
else:
    count = 0
    for i in range(1000):
        count += n // (2*(5**(i+1)))
    print(count)

Submission status: Wrong Answer

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 = [len(str(ab)) - 1 for ab in AB if ab % 10 == 0]
  ans = np.sum(ab)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ans = 0

if N%2 == 0:
    for i in range(100000000000):
        fact = 10 *(5 ** i)
        if fact<=N:
            ans+= math.floor(N/fact)
        else:
            break


print(int(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
res=0
if (n%2)==0:
    x=5
    while True:
        if (n//x)==0:
            break
        d=n//x
        if d&2:
            d=(d-1)//2
        else:
            d//=2
        res+=d
        x*=5
print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
while n<5:
  n=n/5
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n<=3:
    print(1)
elif n%2==1:
    print(0)
else:
    count = 0
    for i in range(200):
        count += n // (2*(5**(i+1)))
    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def func(keta, kaisuu):
    if(keta <= 1):
        return kaisuu
    else:
        return keta * kaisuu + func(keta-1, 9)

N = int(input())

keta = len(str(N))
kaisuu = N // pow(10, keta-1)

if (N % 2 == 0):
    result = func(keta-1, kaisuu)
    print(result)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import math

n=int(input())

c=0
i=1
tmp=math.floor(n/2)
while tmp!=0:
  tmp=math.floor(tmp/5)
  c=c+tmp
if n%2==0:
  print(int(c))
else:
  print(int(0))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
num = 10
cnt = 0
if N%2!=0:
  print(0)
  exit()
for i in range(1, N+1):
  cnt += math.floor(N/num)
  num = num*5
  if num > N:
    break
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

def func(x):
    flag = 0
    while x>=5:
        flag += (x//5)
        x /=5


    return flag

if N%2 ==1:
    print(0)
else:
    print(int(func(int(N/2))))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
N = int(input())
ans = 0
cur = 10
while N/cur >= 1:
    ans += N//cur
    cur *= 5
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

n=int(input())

c=0
i=1
tmp=math.floor(n/2)
while tmp!=0:
  tmp=math.floor(tmp/5)
  c=c+tmp
if n%2==0:
  print(int(c))
else:
  print(0)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
if N < 2:
  ans = 0
else:
  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)
    Ans = [len(str(ab)) - 1 for ab in AB if ab % 10 == 0]
    ans = np.sum(Ans)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
num = 10
cnt = 0
if N%2!=0:
  print(0)
else:
  while num <= N:
    cnt += math.floor(N/num)
    num = num*5
  print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

    print(ans)

Submission status: Wrong Answer

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

if n % 2 == 0:
    j = 10
    while j < n:
        a += n // j
        j *= 5

# print("10: {} 50: {}".format(a, b))

print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

r = 0
for i in range(99):
    r += N // 10 // 5 ** i

print(r)

Submission status: Wrong Answer

Solution code:
from math import floor


def main():
    N = int(input())
    
    r = 10
    ans = 0
    while N >= r:
        ans += floor(N / r)
        r *= 5
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
x = 10
cnt = 0
while x <= N:
    cnt += (N//x)
    x *= 5
print(cnt)

Submission status: Wrong Answer

Solution code:
import math

n=int(input())

c=0
i=1
while 5**i<n:
  c=c+math.floor(n/(2*5**i))
  i+=1
if n%2==0:
  print(int(c))
else:
  print(0)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ans_list = []
a = 0

if N % 2 == 0:
    for i in range(1, 100):
        ans_list.append(math.floor((N/2) / 5**i))
    # print(ans_list)
    for idx, ans in enumerate(ans_list):
        # print(len(ans_list), idx)
        if idx+1 < 90:
            a += (ans - ans_list[idx+1])*(idx+1)
        else:
            a += (ans)*(idx+1)

        # print(a, (ans - ans_list[idx+1]), idx+1)
    print(a)

else:
    print(0)

Submission status: Wrong Answer

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

if n % 2 == 0:
    a = n // 2

    b = 0
    j = 10
    while j < n:
        b += n // j
        j *= 5

    a = min(a, b)

# print("10: {} 50: {}".format(a, b))

print(a)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
if n%2==1:
    print(0)
else:#2,4,6,8,10...
    n=round(n/2)
    k=0
    while n>0:
        k+=math.floor(n/5)
        n=math.floor(n/5)
    print(k)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
num = 10
cnt = 0
if N%2==1:
  print(0)
else:
  while num <= N:
    cnt += math.floor(N/num)
    num *= 5
  print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2==0:
  n=int(N/2)
  k=1
  c=0
  while 5**k <= n:
    c=c+n//5**k
    k=k+1
  print(c)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
j = 0
i = 1

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:#2,4,6,8,10...
    n=round(n/2)
    k=0
    while n>0:
        k+=round(n/5)
        n=round(n/5)
    print(k)

Submission status: Wrong Answer

Solution code:
N = int(input())

def func(x):
    flag = 0
    while x>=5:
        flag += (x//5)
        x /=5


    return flag

if N%2 ==1:
    print(0)
else:
    print(func(int(N/2)))

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2!=0:
  print(0)
m=10
a=0
while m<=N:
  a+=N//m
  m=m*5
print(a)

Submission status: Wrong Answer

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(int(n/10)+1):
    a=i+a
  print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2==0:
  N=N/2
  c=0
  while 5 <= N:
    c=c+int(N/5)
    N=int(N/5)
  print(c)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
j = 0
i = 1

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

Submission status: Wrong Answer

Solution code:
n=int(input())

c=0
i=1
while 5**i<n:
  c=c+(n-n%(2*5**i))/(2*5**i)
  i+=1
if n%2==0:
  print(int(c))
else:
  print(0)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
N = int(input())
ans = 0
cur = 10
while N/cur > 1:
    ans += N//cur
    cur *= 5
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

c=0
i=1
while 5**i<n:
  c=c+(n-n%(2*5**i))/(2*5**i)
  i+=1
if n%2==0:
  print(c)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())

def func(x):
    flag = 0
    while x>=5:
        flag += (x/5)
        x /=5
        

    return flag

if N%2 ==1:
    print(0)
else:
    print(func(int(N/2)))

Submission status: Wrong Answer

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(int(n/10)):
    a=i+a
  print(a)

Submission status: Wrong Answer

Solution code:
s=int(input())
list=[]
for i in range(25):
  list.append(pow(5,i+1)*2)
a=0
for j in range(len(list)):
  a+=s//list[j]
print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2!=0:
  print(0)
m=N//10
a=m
i=1
while m!=0:
  m=N//(10*5**i)
  a+=m
  i+=1
print(a)

Submission status: Wrong Answer

Solution code:
# import numpy as np
import sys
import math
input = sys.stdin.readline

N = int(input())

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

res = 0

temp = 10

while N >= temp:
    res += math.floor((N*1.0)/temp)
    temp *= 5

print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:#2,4,6,8,10...
    n=int(n/2)
    k=0
    while n>0:
        k+=int(n/5)
        n=int(n/5)
    print(k)

Submission status: Wrong Answer

Solution code:
n = input()

alpha = int(n[0])
beta = len(n) - 1

n = int(n)

five = 0
cnt = 1
x = 50
while x <= n:
    five += n // x * cnt
    cnt += 1
    x *= 10

ans = n // 10 + five
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2!=0:
  print(0)
m=N//10
a=m
i=1
while m!=0:
  m=N//(10*5**i)
  a+=m
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

out = 0
if N // 2 == 1 or N < 10:
    print(0)
else:
    for i in range(1, len(str(N)) * 2 + 1):
        out = out + N // (5 ** i)
print(out)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
for i in range(1, 20):
    count = n // (5**i * 2)
    if count == 0:
        break
    ans += count

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
N //= 2
if N & 1:
    print(0)
    exit()
while N:
    N //= 5
    ans += N

print(ans)

Submission status: Wrong Answer

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

N = int(input())

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

res = 0

temp = 10

while N >= temp:
    res += math.floor((N*1.0)/temp)
    temp *= 5

print(res)

Submission status: Wrong Answer

Solution code:
def f(n):
	if n % 2 == 1:
		return 1
	n = n // 2
	ans = 0
	while n:
		n = n // 5
		ans += n
	return ans

if __name__ == "__main__":
	n = int(input())
	print(f(n))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import floor
N = int(input())
if N % 2 != 0:
    print(0)
    exit()
else:
    ans = 0
    # print(5**26 > 10 ** 18)
    i = 1
    m = 10
    while N >= m :
        ans += floor(N / m)
        m *= 5
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

if N%2 == 0:
    for i in range(100000000000):
        fact = 10 *(5 ** i)
        if fact<=N:
            ans+=int(N/fact)
        else:
            break


print(int(ans))

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])

    if n % 2 != 0:
        return '0'

    ret = 0
    d = 10
    while d < n:
        ret += n//d
        d *= 5

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

Solution code:
# import numpy as np
import sys
import math
input = sys.stdin.readline

N = int(input())

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

res = 0

temp = 10

while N >= temp:
    res += math.floor(N/temp)
    temp *= 5

print(res)

Submission status: Wrong Answer

Solution code:
# import math
# n = int(input())
# output = 1
# for i in range(math.ceil(n/2)):
#   output *= n - i*2
# print(str(output)[-150:])

import math

n = input()
d = len(n)
num = int(n)

output = 0
if num % 2 != 0:
  print(0)
else:
  if d <= 1:
    print(0)
  else:
    target = 5 * 10**(d-1)
    # print('target:{}'.format(target))
    output = math.floor(num / 10)
    # 5X以上（500）
    if num >= target:
      for x in range(1,d):
        output += math.floor(num / (10**x * 5)) * x
        # print('5X以上（500）, x{}, output:{}'.format(x, output))
    # 5Xより小さい
    else:
      if d > 2:
        for x in range(1,d-1):
          # print('5Xより小さい, x{}, output:{}'.format(x, output))
          output += math.floor(num / (10**x * 5)) * x
    print(output)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
if N%2==0:
  n=int(N/2)
  k=1
  c=0
  while 5**k <= n:
    c=c+math.floor(n/5**k)
    k=k+1
  print(c)
else:
  print(0)

Submission status: Wrong Answer

Solution code:

from sys import stdin

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

j = 0
for i in range(max(len(str(n-2)),0)):
 j = j + 1

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

Submission status: Wrong Answer

Solution code:
num = int(input())
count = 0
divider = 10
if num%2==0:
  while int(num/divider) > 0:
    count += int(num/divider)
    divider *= 5
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=0
if n%2==0:
    m=10
    while(n>m):
        s+=n//m
        m*=5
print(s)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2!=0:
  print(0)
m=N//10
a=m
while m!=0:
  m=m//5
  a+=m
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
#a,b = map(int,input().split())
N = n
cnt = 0
num = 0
while N:
    cnt += n//5**num
    num += 1
    N = N//5
print(cnt)

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])

    ret = 0
    d = 10
    while d < n:
        ret += n//d
        d *= 5

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

if N%2 == 0:
    for i in range(100000000000):
        if 10*(5**i)<N:
            ans+=N//(10*(5**i))
        else:
            break


print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import floor
N = int(input())
ans = 0
# print(5**26 > 10 ** 18)
i = 1
while N >= 5**i * 2 :
    ans += floor(N / (5**i * 2))
    i += 1
print(ans)