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
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

def valid(tgt):
    # a = nums[tgt]
    a = tgt
    valid = 0
    while (True):
        # print(valid, a)
        if a % 10 == 0:
            valid += 1
            a = a // 10
        else:
            break
    return valid

def main():
    n = input().strip()
    #
    # n = 100
    # nums = [0 for i in range(int(100001))]

    # tmp = 1
    # for i in range(1,50001):
    #     # print(i)
    #     tmp = i * 2 * tmp
    #
    # print("val")

    # print(valid(tmp))
    # for i, num in enumerate(nums[:1001]):
    #     print(str(i) + ":" +str(num))
    # while(True):
    """
    tval = 0
    
    for i in range(5001):

        tgt = i * 2
        valv = valid(nums, tgt)
        if tval != valv:
            print("{} : {}".format(tgt, valv))
            tval = valv
    return
    """

    keta = [0 for i in range(20)]
    keta[1] = 1
    keta[2] = 12
    for i in range(3, 20):
        keta[i] = keta[i-1] * 10 + 4
        if i > 3:
            keta[i] += 5

    print(keta)
    ans = 0
    if int(n[-1]) % 2 == 1:
        print(0)
        return

    else:
        prev = ""
        pprev = ""
        for i, digit in enumerate(n[::-1]):
            ans += int(digit) * keta[i]
            if i == 1:
                bonus = int(digit) // 5
            elif i == 2:
                bonus = int(digit + prev) // 25
            else:
                bonus = int(digit + prev + pprev) // 125
                if int(digit + prev + pprev) >= 625:
                    bonus += 1
            ans += bonus
            prev = digit
            pprev = prev

        print(ans)



if __name__ == "__main__":
    main()

"""
1000
124
2000
249
3000
374
4000
499
5000
624
6000
748
8000
999
9000
1124
10000
1249

"""

Submission status: Wrong Answer

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

n = I()
if n%2 == 1:
    print(0)
    exit()
lis = []
for i in range(1,19):
    lis.append(n // (10**i))
#print(sum(lis),lis)
z = []
for i,e in enumerate(lis):
    z.append((i+1)*e)
#print(sum(z),z)
print(sum(z))

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=10
    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))

Submission status: Wrong Answer

Solution code:
N=int(input())
c=N%10
if c%2==1:
  print("0")
else:
  i=1
  b=0
  while i<=18:
    b+=int(N/(10**i))
    i+=1
  else:
    print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__=="__main__":
  main()

Submission status: Wrong Answer

Solution code:
n=int(input())


def findTrailingZeros(n):
    # Initialize result
    count = 0

    # Keep dividing n by
    # powers of 5 and
    # update Count
    i = 5
    while (n / i >= 1):
        kk=int(n/i)
        if kk%2==0:
            count += (kk//2)
        else:
            count+=((kk-1)//2)
        i *= 5

    return int(count)
get5s=findTrailingZeros(n)

print(get5s)

Submission status: Wrong Answer

Solution code:
S = input()
keta = len(S)
N = int(S)

ans = N // 10
j = 5
while j <= N//10:
    ans += (N//10)//j
    j *= 5

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
1000000000000000000

Submission status: Wrong Answer

Solution code:
N = int(input())
num = N
ans = 1
for i in range(int(N / 2)):
  ans *= num
  num -= 2
print(ans)

Submission status: Wrong Answer

Solution code:
#e

n = int(input())

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

#n * (n-2) * ... * 3  if n is odd
#n * (n-2) * ... * 2 if n is even
# 2,4,6,8,10,...50,...,250,...,1250
# 10
# 20 * 50
# 40 * 250
# 60 * 500
if n % 2 == 1: ans = 0
else:
    ans = 0
    k = 5
    while 2 * k < n:
        ans += n // (2 * k)
        k *= 5

print(int(ans))

Submission status: Wrong Answer

Solution code:
from sys import stdin


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


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


def solve2(N):
    if N % 2 == 1:
        return 0
    if N == 0:
        return 0
    a = N // 50
    b = N // 10
    return b + a


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

    # ans = []
    # for x in range(1, 300):
    #     result = solve(x)
    #     ans.append((x, result))

    # for x in ans:
    #     a, b = x
    #     print(a, b)

    # current = 0
    # count = 0
    # for x in ans:
    #     a, b = x
    #     if a % 2 == 1:
    #         continue
    #     if b == current:
    #         count += 1
    #     elif b == current + 1:
    #         print(current, count)
    #         current = b
    #         count = 0
    #     else:
    #         print(current, count)
    #         print(current + 1, 0)
    #         current = b
    #         count = 0


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

def valid(tgt):
    # a = nums[tgt]
    a = tgt
    valid = 0
    while (True):
        # print(valid, a)
        if a % 10 == 0:
            valid += 1
            a = a // 10
        else:
            break
    return valid

def main():
    n = input().strip()
    #
    # n = 100
    # nums = [0 for i in range(int(100001))]

    # tmp = 1
    # for i in range(1,50001):
    #     # print(i)
    #     tmp = i * 2 * tmp
    #
    # print("val")

    # print(valid(tmp))
    # for i, num in enumerate(nums[:1001]):
    #     print(str(i) + ":" +str(num))
    # while(True):
    """
    tval = 0
    
    for i in range(5001):

        tgt = i * 2
        valv = valid(nums, tgt)
        if tval != valv:
            print("{} : {}".format(tgt, valv))
            tval = valv
    return
    """

    keta = [0 for i in range(20)]
    keta[1] = 1
    keta[2] = 12
    for i in range(3, 20):
        keta[i] = keta[i-1] * 10 + 4
        if i > 3:
            keta[i] += 5

    # print(keta)
    ans = 0
    if int(n[-1]) % 2 == 1:
        print(0)
        return

    else:
        prev = "0"
        pprev = "0"
        for i, digit in enumerate(n[::-1]):
            ans += int(digit) * keta[i]
            if i == 1:
                bonus = int(digit) // 5
            elif i == 2:
                bonus = int(digit + prev) // 25
            else:
                bonus = int(digit + prev + pprev) // 125
                if int(digit + prev + pprev) >= 625:
                    bonus += 1
            ans += bonus
            prev = digit
            pprev = prev

        print(ans)



if __name__ == "__main__":
    main()

"""
1000
124
2000
249
3000
374
4000
499
5000
624
6000
748
8000
999
9000
1124
10000
1249

"""

Submission status: Wrong Answer

Solution code:
n = int(input())
now = 10
ret = 0
while now <= n:
  ret += (n//now)
  now *= 5
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

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

N = ri()

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

answer = N // 10

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

if n % 2 == 1:
    print(0)
elif n % 2 == 0:
    for i in range(1, 26):
        ans += int((n // (5 ** i)) / 2)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

def valid(tgt):
    # a = nums[tgt]
    a = tgt
    valid = 0
    while (True):
        # print(valid, a)
        if a % 10 == 0:
            valid += 1
            a = a // 10
        else:
            break
    return valid

def main():
    n = input().strip()
    #
    # n = 100
    # nums = [0 for i in range(int(100001))]

    # tmp = 1
    # for i in range(1,50001):
    #     # print(i)
    #     tmp = i * 2 * tmp
    #
    # print("val")

    # print(valid(tmp))
    # for i, num in enumerate(nums[:1001]):
    #     print(str(i) + ":" +str(num))
    # while(True):
    """
    tval = 0
    
    for i in range(5001):

        tgt = i * 2
        valv = valid(nums, tgt)
        if tval != valv:
            print("{} : {}".format(tgt, valv))
            tval = valv
    return
    """

    keta = [0 for i in range(20)]
    keta[1] = 1
    keta[2] = 12
    for i in range(3, 20):
        keta[i] = keta[i-1] * 10 + 4
        if i > 3:
            keta[i] += 5

    print(keta)
    ans = 0
    if int(n[-1]) % 2 == 1:
        print(0)
        return

    else:
        prev = "0"
        pprev = "0"
        for i, digit in enumerate(n[::-1]):
            ans += int(digit) * keta[i]
            if i == 1:
                bonus = int(digit) // 5
            elif i == 2:
                bonus = int(digit + prev) // 25
            else:
                bonus = int(digit + prev + pprev) // 125
                if int(digit + prev + pprev) >= 625:
                    bonus += 1
            ans += bonus
            prev = digit
            pprev = prev

        print(ans)



if __name__ == "__main__":
    main()

"""
1000
124
2000
249
3000
374
4000
499
5000
624
6000
748
8000
999
9000
1124
10000
1249

"""

Submission status: Wrong Answer

Solution code:
n  = int(input())
d  = 10
k  = 0
xs = []

while d <= n:
	xs.append(n // d)
	d *= 10
	k += 1
	
xs = reversed(xs)

c = 0
p = 0

for x in xs:
	c += k * (x - p)
	k -= 1
	p  = x

print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=n
tmp=n
ans=0
if n>2:
  for i in range(n//2-1):
    tmp=tmp*(a-2)
    a=a-2
l=len(str(tmp))
for i in range(l):
  q=i+1
  if str(tmp)[l-q]=="0":
    ans=ans+1
  else:
    break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N =int( input())
N_org = N
numdigits = 0
while True:
  if N < 10:
    break
  N = N / 10
  numdigits += 1
ret = 0    
for i in range(1,numdigits):
  ret += (10 ** (i+1) - 10 ** i) // 2 * i
ret += (N_org-10**numdigits) //2* numdigits
print(ret)

Submission status: Wrong Answer

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

import sys
import math

N = int(input())

# 奇数のときは0
if N % 2 != 0:
    print(0)
    sys.exit()

# １桁のときは0
if N < 10:
    print(0)
    sys.exit()

# 扱いやすいように配列にする
d = len(str(N))
n = [int(s) for s in list(str(N))]

# 含まれる10倍数の個数だけ末尾0が増える
def check(n, c):
    if len(n) == 0:
        return 0

    # 末尾
    a = n.pop()
    # 0のときは10扱いにする
    a = 10 if a == 0 else a

    return c * a + check(n, c * a)

n.pop()
print(check(n, 1))

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n < 2:
    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 += n // x
    k += 1

print(ans)

Submission status: Wrong Answer

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

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:
            print(count)
            break
        else:
            count += int(check/waru)
            n += 1

else:
    print(0)

Submission status: Wrong Answer

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

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

def one_str():
    return input()

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

N=one_int()

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

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0


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


for i in reversed(str(f(N))):
    if i == "0":
        cnt += 1
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
def trail(N):
	if N&1:
		return 0
	cnt=0
	x=1
	while x*10 < N:
		cnt+=(N//(x*10))
		x=5*x
	return cnt
print(trail(int(input())))

Submission status: Wrong Answer

Solution code:
n=int(input())


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)//2)
        i *= 5

    return int(count)
get5s=findTrailingZeros(n)

print(get5s)

Submission status: Wrong Answer

Solution code:
#e

n = int(input())

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

#n * (n-2) * ... * 3  if n is odd
#n * (n-2) * ... * 2 if n is even
# 2,4,6,8,10,...50,...,250,...,1250
# 10
# 20 * 50
# 40 * 250
# 60 * 500
if n % 2 == 1: ans = 0
else:
    ans = 0
    k = 5
    while 2 * k < n:
        ans += n // (2 * k)
        k *= 5

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 2:
  print(1)
elif n % 2 == 1:
  print(0)
  exit()
else:
  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:
def main():
  N = int(input())
  count = 0
  if N%2==1:
    print(count)
    return
  for i in range(1,100):
    count += int(N/(2*(5**i)))
  print(count)

if __name__=="__main__":
  main()

Submission status: Wrong Answer

Solution code:
def f(n):
    ans=0
    i=10
    for j in range(n):
        if n>=i:
            ans+=n//i
            i*=5
        else:
            break
    return ans

n=int(input())
print(f(n))

Submission status: Wrong Answer

Solution code:
def trail(N):
	cnt=0
	x=1
	while x*10 < N:
		cnt+=(N//(x*10))
		x=5*x
	return cnt
print(trail(int(input())))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
 
if n % 2 == 1:
  print(0)
  exit()
else:
  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())

def f2(n):
  return 1

def f(n):
    c = 0
    while n >= 1:
        if c == 0:
            s = n

        else:
            s *= n
        n = n - 2
        c += 1
    
    return s
  
if N < 1:
  g = f2(N)

else:
  g = f(N)
  
print(g)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n = int(input())
    str_n = str(n)
    sum = 0
    count=0
    n2 = n
    if n % 2 ==1:
        print(0)
    else:
        while n2 > 2:
            if n2 % 10 ==0:
                sum =sum+ len(str(n2))-1
                if str(n2)[0] =="5":
                    sum = sum +1
            n2 =n2-2

    print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N%2 != 0:
    print(0)
else:
    count = 0
    while N >= 10:
        N /= 10
        count += 1
    ans = count
    i = 1
    while i < count:
        ans += 9 * int("1"*i)
        i += 1
    print(ans)

Submission status: Wrong Answer

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

N = int(input())

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

Submission status: Wrong Answer

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


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


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


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


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


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


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


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


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


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


show_flg = True
show_flg = False


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

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


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

    while n <= N:
        ans += N // n // 2
        n *= 5

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())

i=1
num=N*(N-2)
while (N-2*i)>=1:
    num=num*(N-2*(i+1))
    i+=1
    
       
flag=0
surplus=num
while 1:
    num=num/10
    surplus=num%10
    if surplus==0:
        flag+=1
    else:
        break;
    break;
    
print(flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import log10

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

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=10
    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))

Submission status: Wrong Answer

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

n = int(input())

if n < 2:
  print(1)
  exit()

if n % 2 == 1:
  print(0)
  exit()
# 偶数の時
else:
  if n > 9:
    a = n // 10
    print(calc(a,n))
  else:
    print(0)
    exit()

Submission status: Wrong Answer

Solution code:
a = int(input())
ans = 0
if a < 6:
	print(0)
elif a % 10 != 0:
	print(1)
else:
	ans += a/5 + a/25 + a/125
	print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
temp = N
A = []
c = 1
for i in range(int(N/2)-1):
    N -= 2
    A.append(N)
A.insert(0,temp)
for i in A:
    c *= i
d = 0
c = str(c)
c = c[::-1]
#print(c)
for i in c:
    #print(i)
    if i == str(0):
        d += 1
    else:
        break
print(d)

Submission status: Wrong Answer

Solution code:
import decimal

N = input()
N = decimal.Decimal(N)

five = 0
i = 0
if N % 2 == 1:
    print(0)
else:
    while True:
        i += 1
        if 2 * (5 ** i) > N:
            break
        else:
            five += N // (decimal.Decimal(2) * decimal.Decimal(5)**decimal.Decimal(i))
print(five)

Submission status: Wrong Answer

Solution code:
N = int(input())

n_str = list(str(N))

n_str.reverse()

ans = 0

if int(n_str[0])%2==1:ans = 0
else:
    for i in range(1, len(n_str)):
        ans += int(n_str[i]) * int('1'*i)
    
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
def fact(N,k):
  t=0
  c=0
  while(k**t<N):
    t=t+1
  for i in range(1,t+1):
    c+=N//(k**i)
  return c
if N%2!=0:
  print(0)
else:
  c2=fact(N,2)
  c5=fact(N,5)
  print(min(c2,c5))

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
for i in range(1,28):
  cnt+=n//((5**i)*2)
print(cnt)

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:
from math import log

N = int(input())

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

while N % 10 != 0:
    N -= 1

answer = 0

x = 1
while N // (5**x) > 0:
    answer += int((N//(5**x)) / 2)
    x += 1

print(answer)

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 int(N/(2*(5**i)))<0:
      break
    count += int(N/(2*(5**i)))
  print(count)

if __name__=="__main__":
  main()

Submission status: Wrong Answer

Solution code:
N = int(input())

def f2(n):
  return 1

def f(n):
    c = 0
    while n >= 1:
        if c == 0:
            s = n

        else:
            s *= n
        n = n - 2
        c += 1
    
    return s
  
if N < 2:
  g = f2(N)

else:
  g = f(N)
  
print(g)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import decimal

N = input()
N = decimal.Decimal(N)

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:
def two_int():
    N, K = map(int, input().split())
    return N,K

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

def one_str():
    return input()

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

N=one_int()

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 2:
  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:
N=int(input())
if N%10==0:
  print(int(N/10))
elif N%10==1:
  print("0")
elif N%10==2:
  print(int((N-2)/10))
elif N%10==3:
  print("0")
elif N%10==4:
  print(int((N-4)/10))
elif N%10==5:
  print("0")
elif N%10==6:
  print(int((N-6)/10))
elif N%10==7:
  print("0")
elif N%10==8:
  print(int((N-8)/10))
else:
  print("0")

Submission status: Wrong Answer

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

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

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

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 = check_five(N) - check_ten(N)

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:
def main():
  N = int(input())
  count = 0
  if N==0:
    print(1)
    return
  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())


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)
get5s=findTrailingZeros(n)
if get5s==1 or get5s==0:
    print(0)
else:
    if get5s%2==0:
        print(get5s//2)
    else:
        print((get5s-4)//2 )

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:
            count += check//waru
            n += 1
        else:
            print(count)
            break
else:
    print(0)

Submission status: Wrong Answer

Solution code:
N=input()
iN=int(N)
m=len(N)

z_num=[0 for i in range(m)]
if len(z_num)>1:
    z_num[1]=1

for i in range(2,m):
    z_num[i]=(z_num[i-1])*10+1
    

ans=0
lN=list(N)
lN.reverse()

for i in range(m):
    ans+=z_num[i]*int(lN[i])

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

if n%2 == 1:
    print("0")
else:
    for i in range(len(str(n))-1):
        ans += int(n/(10**(i+1)))
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
if(n%2 == 1):
	print(0)
else:
  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())
count=0
if n%2==1:
    print(0)
else:
    m=n//10
    count+=m
    for i in range(1,25):
        count+=m//5**i
print(count)

Submission status: Wrong Answer

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

l = int(math.log10(n))+1
cnt = 0
for i in range(1,10*l):
  cnt += (n // 5 ** i) // 2
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
d = 2
count = 0
if N % 2 == 1:
    print(0)
else:
    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())
m = n//2
list = []
ans = 0
if n%2==1:
    print(0)
else:
    for j in range(1,10000):
        ans += m//(5**j)
print(ans)

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 = check_five(N) - check_ten(N)

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

trailing_zeros = 0

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


base = 10

while (n//(base) != 0):
    trailing_zeros += n//base
    base *= 10

print(trailing_zeros)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

def one_str():
    return input()

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

N=one_int()

sums =0
for i in range(1,25):
    sums += (N/2)//(5**i)

print(int(sums) - N//200000000000000000)