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:
import sys
import math
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

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

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(30):
	pau = 2 * 5 ** (i+1)
	ans = ans + int(n / pau)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

if n > 9:
  a = n // 10
else:
  print(0)
  exit()

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

print(calc(a,n))

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if (n%2 != 0):
    print(0)
    sys.exit()
else:
    s = 0
    while (n%10 == 2):
        n -= 2
    i = n
    while (i > 1):
        if (i%10 == 0):
            s += i/10
        i -= 10
print (int(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  count = 0
  if N %2 ==1:
    print(0)
    return
  for i in range(1,100):
    if 2*(5**i)>N:
      break
    count += int(N/(2*(5**i)))
  print(count)

if __name__=="__main__":
  main()

Submission status: Wrong Answer

Solution code:
n = int(input())

if n % 2 != 0:
    print(0) # 奇数は10が現れない
else:
    s = str(n)
    m = len(s) - 1
    print(int(m * (m + 1) / 2))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=5
cnt=0
while a<=N:
    cnt+=(N//a)//2
    a*=5
print(cnt)

Submission status: Wrong Answer

Solution code:
s = input().split()
N = int(s[0])
count=0
i=5
if N%2==0:
    while i <= N:
        count+=int(N/i/2)
        i=i*5
    print(count)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N%2==0:
  #array = list(range(N+2)[2::2])
  #print(array)
  count = 0
  x = 10
  while x <= N:
    y=x
    while True:
      if y%5==0:
        count+=1
        y=y//5
      else:
        break
    x += 5
  
  print(count)
else:
  print(0)

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 += int(n / j)
  print(c)

Submission status: Wrong Answer

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

l = 1
while(True):
  if n <= pow(5, l):
    break
  l+=1

for i in range(1, l):
  ans += n//pow(5, i)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 1
b = 0
if N % 2 == 1:
  print(0)
else:
  while N >= 2:
    a = a * N
    N = N - 2
  while a % 10 == 0:
    b += 1
    a = a / 10
  print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())//2
list = []
ans = 0
if n%2==1:
    print(0)
else:
    for j in range(1,10000):
        ans += n//(5**j)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while n>=3:
  sum*=n-2
  n-=2
 
s_num=str(sum)
lst=[i for i in s_num]
lst.reverse()

cnt=0
for i in lst:
  if i=="0":
    cnt+=1
  else:
    break
print(cnt)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=1
while(0<a):
    ans=ans*a
    a=a-2

a=str(a)
c=0
for i in range(len(a)):
    if a[len(a)-1]=="0":
        c+=1
    else:
        break
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

if n > 9:
  a = n // 10
else:
  print(0)
  exit()

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

print(calc(a,n))

Submission status: Wrong Answer

Solution code:
n = int(input())//2
list = []
ans = 0
if n%2==1:
    print(0)
else:
    for j in range(1,100):
        ans += n//(5**j)
print(ans)

Submission status: Wrong Answer

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

if n % 2 == 0:
    # n//2の階乗の0の個数
    k = n//2
    cnt = 0
    d = 5
    while True:
        
        cnt += k // d
        if k // d  == 0:
            break
        d *= 5
        
    print(cnt)
    sys.exit()

else:
    k = n //2  + 1 
    if k <= 10:
        print(0)
        sys.exit()
    cnt = 0
    d = 5
    while True:
        
        cnt -= k // d
        if k // d  == 0:
            break
        d *= 5

    d = 5
    while True:
        cnt += 2*k // d
        if 2*k //d == 0:
            break
        d *= 5
    
    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
N = N // 2
for i in range(1, 26):
  ans += N // 5 ** i
print(ans)

Submission status: Wrong Answer

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


def solve():
    N = int(input())
    if N%2==1:
        print(0)
    else:
        ans=0
        for i in range(1,26,1):
            chk = (5**i)*2
            if N<chk:
                break
            else:
                ans += int(N/chk)
        print(ans)


if __name__ == '__main__':
    solve()

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, 40):
    j = 10 * (5 ** i)
    c += int(n / j)
  print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  count = 0
  if count %2 ==1:
    print(0)
    return
  
  for i in range(1,100):
    if 2 * 5**i > N:
      break
    count += int(N/(2 * 5**i))
  print(count)

if __name__=="__main__":
  main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
y = 0
if n % 2 == 0:
    for i in range(1, n):
        k = (5**i) * 2
        if n >= k:
            y += n // k
        else:
            break
else:
    for i in range(1, n):
        k = (5**i)
        if n >= k:
            y += n // k - (n // k) // 2
        else:
            break
print(y)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    c=0
    i=0
    while True:
        i+=1
        c+=int(n/((5**i)*2))
        if int(n/(5**i))==0:
            break
        #i+=1
    print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
   
def func(n):
  if n < 5:
    return 0
  else:
    nn = int(n / 5)
    return nn + func(nn)

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

Submission status: Wrong Answer

Solution code:
N = int(input())

res = 1
for i in range(2,N+1, 2):
    res *= i

print(res)

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

print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
d = 2
count = 0

for i in range(N+1):#n回回す　0~n-1まで
    d *= 5
    if d > N:
        break
    count += int(N/d)
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    c=0
    i=0
    while True:
        i+=1
        c+=int(n/((5**i)*2))
        if int(n/((5**i)*2))==0:
            break
        #i+=1
    print(c)

Submission status: Wrong Answer

Solution code:
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


def n_elems(n, div):
    if n < div:
        return 0
    else:
        ret = 0
        while n % div == 0:
            ret += 1
            n //= div
        return ret


def main():
    # N = int(input())
    # a = list(map(int, input().split()))
    N = int(input())
    if N == 0 or N == 1:
        print(0)

    # n2 = 0
    # n5 = 0
    if N % 2 == 1:
        print(0)
    else:
        # for n in range(2, N, 2):
        #     # print(n)
        #     # n2 += n_elems(n, 2)
        #     n5 += n_elems(n, 5)
        # print(n5)
        N //= 2
        n5 = 0
        # n5 += N //5
        i = 1
        while 5**i <= N:
            n5 += N // (5**i)
            i += 1

        print(n5)

    # print(min(n2, n5))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n % 2 == 1:
    print(0)
    exit()
    
five_list = []
five = 5
while five*2 < n:
    five_list.append(five)
    five = five * 5
count = 0
for f in five_list:
    count += math.floor(n/(f*2))
print(count)

Submission status: Wrong Answer

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

N = int(input())
x = (N // 10  + N // 50 + N // 250 + N // (250 * 5))
k = 10
ans = 0
while True:
    t = N // k
    if t == 0:
        break
    ans += t
    k *= 5
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if n % 2 == 0:
    # n//2の階乗の0の個数
    k = n//2
    cnt = 0
    d = 5
    while True:
        
        cnt += k // d
        if k // d  == 0:
            break
        d *= 5
        
    print(cnt)
    sys.exit()

else:
    k = n //2  + 1 
    if k <= 10:
        print(0)
        sys.exit()
    cnt = 0
    d = 5
    while True:
        
        cnt += k // d
        if k // d  == 0:
            break
        d *= 5

    d = 5
    while True:
        cnt += 2*k // d
        if 2*k //d == 0:
            break
        d *= 5
    
    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = N // 10
k = 50
while k <= N:
    ans += N // k
    k *= 5

print(ans)

Submission status: Wrong Answer

Solution code:
def p_e():
    n = int(input())
    ans = n // 10
    x = 50
    while x <= n:
        ans += n // x
        x *= 5
    print(ans)
    
p_e()

Submission status: Wrong Answer

Solution code:
N = int(input())//10

c=N

while N//5 !=0:
    N = N//5
    c +=N
    
print(c)

Submission status: Wrong Answer

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

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

five_list = []
five = 5
while five*2 <= n:
    five_list.append(five)
    five = five * 5
count = 0
for f in five_list:
    count += math.floor(n/(f*2))
print(count)

Submission status: Wrong Answer

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

k = 0
if N%2 ==0:
  n = N//2
  i = 1
  while n >= 5**i :
    k += math.floor(n /(5**i))
    i += 1

print(k)

Submission status: Wrong Answer

Solution code:

n=int(input())
ans=0
if(n%2==1):
    print(0)
else:
    two=0
    five=0
    i=n
    while(i>=1):
        i=int(i/2)
        two=two+i
    i=int(n/10)
    five=i
    while(i>=1):
        i=int(i/5)
        five=five+i
    print(min(five,two))

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 0 or N == 1:
    print(1)
    exit()

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

answer = 0
cnt = 1
while 5 ** cnt * 2 <= N:
    answer += N // (5 ** cnt * 2)
    cnt += 1

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#import sys
MOD = 10 ** 9 + 7
#input = sys.stdin.readline
import math

import itertools

#import bisect

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

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

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

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

    return result

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

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


def main():
#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]
    n=int(input())
    nn=n//2
    a=nn//5 #base
    b = [a//(10**i) for i in range(1,18)]
    c = [a//(5**i) for i in range(1,50)]
    count=0
#    for i in b:
 #       if i!=0:
  #          count+=i
    for i in c:
        if i!=0:
            count+=i
 #   print(b,c)
    print(count+a)




if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

l = 1
while(True):
  if n <= pow(5, l):
    break
  l+=1

for i in range(1, l):
  ans += n//pow(5, i)//2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def trend(n):
    c = 0
    n = str(n)
    i = len(n)-1
    while n[i] == "0":
        c += 1
        i -= 1
    return c

if n%2 == 1:
    print(0)
else:
    c = 10
    t = 0
    i = 0
    while c <= n:
        i = len(str(c))
        if i%2==0:
            t += (i-1)*n//c
        else:
            t += (i-1)*n//c
        # t += n//c
        c *= 10
    print(t)
    c = 50
    # while c <= n:
    #     i = math.log(c, 50)
    #     if i%2 == 1:
    #         t += (i-1)*n // c
    #     else:
    #         t -= (i-1)*n // c
    #     c *= 5
    # print(t)
    # num = 1
    # for a in range(N,0,-2):
    #     num *= a
    #     print(a, trend(num))
    # print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N%2 != 0:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(1, 26):
  F = 5 ** i * 2
  ans += N // F
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n % 2 != 0:
    print(0) # 奇数は10が現れない
else:
    print(n // 10)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

l = 1
while(True):
  if n < pow(5, l):
    break
  l+=1

for i in range(1, l):
  ans += n//pow(5, i)//2
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
d = 2
count = 0
for i in range(N):
    d *= 5
    if d > N:
        break
    count += int(N/d)
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    c=0
    i=0
    #for i in range(1,int(n/)):
    while True:
        i+=1
        c+=int(n/((5**i)*2))
        if int(n/((5**(i)*2)))==0:
            break
        #i+=1
    print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

N >>= 1

five_count = 5

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    c=0
    i=1
    #for i in range(1,int(n/)):
    while True:
        c+=int(n/((5**i)*2))
        if int(n/((5**(i-1)*2)))==0:
            break
        i+=1
    print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

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

five_list = []
five = 5
while five*2 <= n:
    five_list.append(five)
    five = five * five
count = 0
for f in five_list:
    count += math.floor(n/(f*2))
print(count)

Submission status: Wrong Answer

Solution code:
'''

sekai_no_owari
 愛

''' 

def findTrailingZeros(n): 
      
    # Initialize result 
    count = 0
  
    # Keep dividing n by 
    # powers of 5 and 
    # update Count 
    i=5
    while (n/i>=1): 
        count += int(n/i) 
        i *= 5
  
    return int(count) 

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

if N%2 == 0:
    for i in range(1,100000):
        kaijou = 2*(5**i)
        if N>kaijou:
            ans += int(N/kaijou)
        else:
            break;

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
y = 0
for i in range(1, n):
    k = (5**i) * 2
    if n >= k:
        y += n // k
    else:
        break
print(y)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0
for i in range(1, 50):
    e = 2 * 5 ** i
    if N >= e:
        cnt += int(N / e)
    else:
        break
print(cnt if N % 2 == 0 else 0)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = a1*1 + a2*1 + a3*1 + a4*1 + a5*1 + a6*1 + a7*1 + a8*1 + a9*1 + a10*1 + a11*1 + a12*1 + a13*1 + a14*1 + a15*1 + a16*1 + a17*1 + a18*1 + a19*1
if N % 2 == 1:
  print(0)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
import fractions

n=int(input())
ans=0
if(n%2==1):
    print(0)
else:
    two=0
    five=0
    i=n
    while(i>1):
        i=int(i/2)
        two=two+i
    i=int(n/10)
    five=i
    while(i>1):
        i=int(i/5)
        five=five+i
    print(min(five,two))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
two = 2
two_cnt = 0
while two <= N:
  two_cnt += (N // two) // 2
  two *= 2
five = 5
five_cnt = 0
while five <= N:
  five_cnt += (N // five) // 2
  five *= 5
print(min(two_cnt,five_cnt))

Submission status: Wrong Answer

Solution code:
'''

sekai_no_owari
 愛

''' 

def findTrailingZeros(n): 
      
    # Initialize result 
    count = 0
  
    # Keep dividing n by 
    # powers of 5 and 
    # update Count 
    i=5
    while (n/i>=1): 
        count += int(n/i) 
        i *= 5
  
    return int(count) 

n = int(input())
print(findTrailingZeros(n)//2)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 2 == 1:
    print(0)
if N % 2 == 0:
    N_keta = len(str(N)) - 1
    
    level = 10
    keta_num = list()
    for i in range(1, N_keta + 1):
        keta_num.append(N // (level ** i))
    
    print(sum(keta_num))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = int(input())

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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    ans = 0
    while N > 2:
        if N == 10:
            ans += 1
        N = N-2
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

x = N
fives = 0
i = 0
while x:
    if i % 2 == 1:
        i +=1
        continue
    i += 1
    x //= 5
    fives += x
    #print(x, fives)
fives //= 2
print(fives)

Submission status: Wrong Answer

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

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

cnt = 0
N=str(N)
keta = len(N)

for i in range(keta-1):
  ones = int("1"*(keta - i - 1))
  a = int(N[i])
  cnt += ones * a

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0
for i in range(1, 50):
    e = 2 * 5 ** i
    if N >= e:
        cnt += int(N / e)
    else:
        break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    c=0
    i=1
    #for i in range(1,int(n/)):
    while True:
        c+=int(n/((5**i)*2))
        if int(n/((5**i)*2))==0:
            break
        i+=1
    print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
f=[]
for i in range(N+1):
    if i==1 or i==0:
        f.append(1)
    else:
        f.append(i*f[i-2])

print(f[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
i = 10
while True:
    if i > n:
        break
    ans += n//i
    i *= 5
print(ans)

Submission status: Wrong Answer

Solution code:
import math


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


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


n = int(input())

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

# (2k + 1)!! = (2k + 2)! / (2^(k+1)*(k+1)!)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
count=0
if n%2!=0:
    print(0)
else:
    ini=0
    while count==0:
        ini+=1
        a=n//(10*ini)
        if a==0:
            count=-1
        else:
            ans+=a
    
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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


# 偶数 => 出てくる5の個数
# 奇数 => 0
if n % 2 == 1:
    print(0)
    exit()
else:
    print(f(n))
    print(124999999999999995)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    c=0
    i=1
    #for i in range(1,int(n/)):
    while True:
        c+=int(n/((5**i)*2))
        i+=1
        if int(n/((5**i)*2))==0:
            break
    print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n == 0 or n == 1:
    print("1")
    sys.exit()

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

i = 10
while (n / i >= 1):
  count += int(n / i)
  i *= 5
print(int(count))

Submission status: Wrong Answer

Solution code:
N = int(input())
i = 1
F = 10
ans = 0
while N >= F:
  ans += N // F
  F *= 5
print(ans)

Submission status: Wrong Answer

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

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

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

print(min(two, five))