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 math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()


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

    ret = 0
    n = n / 2
    for i in range(1, 1145141919810):
        if n //pow(5, i) == 0:
            break

        ret += n//pow(5, i)


    print(ret)


main()

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()


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

    ret = 0
    n = n / 2
    for i in range(1, 1145141919810):
        ret += int(n/(5**i))
        if 5**(i-1) > n:
            break


    print(ret)


main()

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()


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

    ret = 0
    n = n / 2
    for i in range(1, 1145141919810):
        ret += int(n/(5**i))
        if 5**i > n:
            break


    print(ret)


main()

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()


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

    ret = 0
    n = n / 2
    while n >= 5:
        n = int(n/5)
        ret += n

    print(ret)


main()

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()


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

    ret = 0
    n = n / 2
    while n <= 5:
        n = int(n/5)
        ret += n

    print(ret)


main()

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()


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

    ret = 0
    n = n / 2
    for i in range(1, 1145141919810):
        if n < 5:
            break
        n = int(n/5)
        ret += n

    print(ret)


main()

Submission status: Wrong Answer

Solution code:
import math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()

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

    ret = 0
    n = n / 2
    for i in range(1, 114514):
        if n < 5:
            break
        n = int(n/5)
        ret += n

    print(ret)


main()

Submission status: Wrong Answer

Solution code:
def count_zero(num):
    i = 10
    count = 0
    while(i <= num):
        count += int(num/i)
        i = i*5
    return count
n = int(input())
if(n % 2 == 0):
    print(count_zero(n))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

else:
    count = 0
    n = n//2
    val  = n/5

    while(val >= 1):
        count += int(val)
        val = val/5

    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

else:
    count = 0
    n = n//2
    val  = n/5

    while(int(val) != 0):
        count += int(val)
        val = val/5

    print(count)

Submission status: Wrong Answer

Solution code:
def count_zero(num):
    i = 10
    count = 0
    while(i <= num):
        count += int(num/i)
        i = i*5
    return count

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

Submission status: Wrong Answer

Solution code:
def count_zero(num):
    i = 10
    count = 0
    while(i <= num):
        count += int(num/i)
        i = i*5
    return count

n = int(input())
print(count_zero(n))

Submission status: Wrong Answer

Solution code:
p=int(input())
if p%2 == 0:
    num=10
    c=0;
    while num <= p:
        c += (p/num)
        num *= 5
    print(c)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
n = int(sys.stdin.readline().strip())
down = 10
accum = 0
while True:
    crt = n // down
    if crt < 1:
        break
    accum += crt
    down *= 5
print(accum)

Submission status: Wrong Answer

Solution code:
N = "1000000000000000000"
if int(N[-1]) %2 == 0:
    ans = int(N[:-1])
    N = int(N[:-1])
    k = 1
    while k != 0:
        k = N // 5
        N = k
        ans += k
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())


n = int(input())
digi = len(str(n))

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

# Nが奇数の時は2が1つもないので0
if N % 2 == 1:
    print(0)
# Nが偶数の時は5は10の倍数にしかないしつまり2は常に5の数より多いので、10の倍数が何回かかるかを数える
else:
    ans = 0
    for i in range(1, 20):
        ans += N // 10 ** i
    print(ans)

Submission status: Wrong Answer

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

else:
  ans=0
  for i in range(1,26):
    ans+= n//(10**i)
  print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

if N % 2 == 0:
    num = 5
    temp_N = N/2
    while num < temp_N:
        ans += temp_N//num
        num *= 5


print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

if N % 2 == 0:
    num = 5
    temp_N = N/2
    while num < temp_N:
        ans += temp_N//num
        num *= 5


print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n % 2 == 1:
  print(0)
else:
  n = n//10
  res = n
  while n > 5:
    n = n//5
    res += n
  print(res)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(20000000)

def fx(X, n):
    if (int(X/n)):
        return fx(int(X/n), n)+int(X/n)
    return 0

N=int(input())
if N%2==1:
  print(0)
else:
  print(fx(N//2,5))

Submission status: Wrong Answer

Solution code:
def fx(X, n):
    if (int(X/n)):
        return fx(int(X/n), n)+int(X/n)
    return 0

N=int(input())
if N%2==1:
  print(0)
else:
  print(fx(N//2,5))

Submission status: Wrong Answer

Solution code:
def fx(X, n):
    if (int(X/n)):
        return fx(int(X/n), n)+(X//n)
    return 0

N=int(input())
if N%2==1:
  print(0)
else:
  print(fx(N//2,5))

Submission status: Wrong Answer

Solution code:

N=int(input())
kai=0
if N%2==1:
    print(0)
else:
    for i in range(20):
        n=N//(5**(i+1)*10)
        kai=kai+n
    kai+=N//10
    print(kai)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

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

tmp = 1
idx = 0
while True:
	tmp *= 5
	if tmp >= n:
		break
	idx += 1

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

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

tmp = 1
idx = 0
while True:
	tmp *= 5
	if tmp >= n:
		break
	idx += 1

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if N%2 == 1:
  print(0)
  exit()
five = 0
for i in range(18):
  five += N//10**(i+1)
print(five)

Submission status: Wrong Answer

Solution code:
n = int(input())


ans = 0
if n % 2 == 0:
    ans = n // 10
    n = n // 10
    while n // 5 > 0:
        ans += n // 5
        n = n // 5

else:
    if (n // 5) % 2 == 0:
        ans = n // 10
        n = n // 10

    else:
        ans = n // 10 + 1
        n = n // 10 + 1

    while n // 5 > 0:
        n = n // 5
        ans += n
print(ans)

Submission status: Wrong Answer

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

if n%2==0:
    n /= 2
    fives = 5
    while 1:

        if fives > n: 
            break
        ans += n // fives
        fives *= 5

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 2:
    print(1)
elif n % 2 != 0:
    print(0)
else:
    ans = 0
    for i in range(1, 100):
        ans += n//(5**i*2)
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n % 2 != 0:
    print(0)
elif n < 2:
    print(1)
else:
    ans = 0
    for i in range(1, 100):
        ans += n//(5**i*2)
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math

n = int(stdin.readline().rstrip())
zeros = 0
if n % 2 != 0:
    print(zeros)
else:
    i = 10
    while i <= n:
        a = math.floor(n/i)
        zeros += a
        i *= 5
    print(zeros)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(50):
    if n>10*(5**(i)):
        ans += n//(10*(5**(i)))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input()) 
size = len(str(n))
count = 0
i = 1
while 5 ** i <= n:
  a = 5 ** i
  b = n // a
  count += b
  i += 1
print(count)

Submission status: Wrong Answer

Solution code:
def main():

    n = int(input())

    if n%2 == 1:
        print(0)
        return
    ans = 0
    n = n // 2

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = input()

dp = [0] * len(N)

ans = 0
length = len(N)
for i in range(1, length):
  dp[i] = int(N[:i]) - dp[i - 1]

ans = 0
t = len(N)
for d in dp:
  ans += d * t
  t -= 1

#print(dp)
if int(N) % 2 != 0:
  print(0)
else:
  print(ans)





"""
1000000000000000000
85321
"""

Submission status: Wrong Answer

Solution code:
n=int(input())

if n%2!=0:
    print(0)
    exit()
if n==0:
    print(1)
    exit()
ans=0
cnt=1
while((5**cnt)*2<n):
    ans+=n//((5**cnt)*2)
    cnt+=1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

ans=0
cnt=1
while((5**cnt)*2<n):
    ans+=n//((5**cnt)*2)
    cnt+=1

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
#f=nf(n-2)

count=0
if N%2==1:
    print(0)
else:
    while N%5!=0:
        if (N-2)%5==0:
            N-=2
    count+=N//10
    #print(count)
    N//=10
    while N>5:
        count+=N//5
        #print(count)
        N//=5
    print(count)
#
"""
def f(n):
    if n>=2:
        answer=n
        n-=2
    while n>=2:
        answer*=n
        n-=2
    return answer
print(f(N))
"""

Submission status: Wrong Answer

Solution code:
from math import factorial

N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
i = 2
while i < n:
  i *= 5
  ans += int(n/i)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

n //5
ans = 0
while n:
  n = int(n/5)
  ans += int(n//2)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
i = 1
while True:
    temp = 2 * (5 ** i)
    count += n // temp
    if temp > n:
        break
    else:
        i += 1

print(count if n // 2 == 0 else 0)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
i = 1
while True:
    temp = 2 * (5 ** i)
    count += n // temp
    
    if temp > n:
        break
    else:
        i += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if n < 10:
    print(0)
elif n >= 10:
    if n % 2 != 0:
        print(0)
    else:
        print(n//10 + n//50)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

N = int(input())
ans=0
p=5
#c2 = 0
if N!=0:

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

print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())
ans=0
p=5
#c2 = 0
c5 = 0
if (N % 2==0):
    N = N/2
    #print(N)
    while(N >= p):
        #print(c5)
        ans += int(N / p)
        p=p*5
        #ans=c5


print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


def main():
    n = int(input())
    if n % 2 == 1:
        print(-1)
        return
    ans = n // 10
    for i in range(1, 32):
        ans += n // (5**i*10)
    print(ans)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N
fn = N
while n>2:
  fn = fn*(n-2)
  n = n-2
fn_str = str(fn)
if fn_str[-1] != '0':
  print(0)
else:
  i = 1
  count = 0
  while i<len(fn_str)+1:
    if fn_str[-i] == '0':
      count = count+1
      i = i+1
    else:
      i = i+1
      break
  print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

import math

cnt=0
num=10
while True:
    cnt+=math.floor(n/num)
    num *= 5

    if num > n:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
import copy

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n = ni()
if n % 2 != 0:
    print(0)
else:
    n2 = copy.copy(n)
    n5 = copy.copy(n)
    c2, c5 = 0, 0
    while n2 > 1:
        n2 //= 2
        c2 += n2
    while n5 > 1:
        n5 //= 5
        c5 += n5//2
    print(c2, c5)
    print(min(c2, c5))

Submission status: Wrong Answer

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

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

r = 0
L = int(mt.log(N,5))
for i in range(1,L+1):
    p = N//(5**i)//2
    r += p
    #print(N,5**i,p)
print(r)

Submission status: Wrong Answer

Solution code:
N = int(input())

exp = 1
counters = []
while 2*(5 ** exp) <= N:
    count = N // (2* (5 ** exp))
    counters.append([exp, count])
    exp += 1

zero_count = 0
for counter in counters:
    zero_count += counter[1]

print(zero_count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    if n%1==0:
        print(0)
        return 
    
    ans = 0
    bunbo = 10
    while bunbo <= n:
        ans += n // bunbo
        bunbo *= 5
    print(ans)
 
 
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    if n%2==0:
        print(0)
        return 
    
    ans = 0
    bunbo = 10
    while bunbo <= n:
        ans += n // bunbo
        bunbo *= 5
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    ans = 0
    bunbo = 10
    while bunbo <= n:
        ans += n // bunbo
        bunbo *= 5
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, ROUND_DOWN
N = int(input())

if N % 2 == 1:
    print(0)
else:
    beki5 = 1
    sum0 = 0
    while 1:
        beki5 = beki5 * 5
        if beki5 > N:
            break
        else:
            sum0 += int(Decimal(N/(beki5*2)).quantize(Decimal("0"), rounding=ROUND_DOWN))
    print(sum0)
a = 0

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 2 == 1:
    print(0)
else:
    beki5 = 1
    sum0 = 0
    while 1:
        beki5 = beki5 * 5
        if beki5 > N:
            break
        else:
            sum0 += int(N/(beki5*2))
    print(sum0)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 0
if N%2 == 1:
    print(0)
else:
    for i in range(1, 21):
        ans += N//(10**i)
        for j in range(1, 27):
            if N >= (5**j)*(10**i):
                ans += math.ceil(N//((5**j)*10**i)/2)    
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 0
if N%2 == 1:
    print(0)
else:
    for i in range(1, 21):
        ans += N//(10**i)
        for j in range(1, 27):
            ans += math.ceil(N//((5**j)*10**i)/2)    
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 0
if N%2 == 1:
    print(0)
else:
    for i in range(1, 21):
        ans += N//(10**i)
        for j in range(1, 36):
            ans += math.ceil(N//((5**j)*10**i)/2)    
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 0
if N%2 == 1:
    print(0)
else:
    for i in range(1, 21):
        ans += N//(10**i)
        for j in range(1, 30):
            ans += math.ceil(N//((5**j)*10**i)/2)    
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
if n % 2 == 1:
    print(0)
    exit()
c = 10
ans = 0
while c <= n:
    ans += math.floor(n / c)
    c *= 5
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
c = 10
ans = 0
while c <= n:
    ans += math.floor(n / c)
    c *= 5
print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
s=0
if x%2==0:
    p=10
    while(p<x):
        s+=x//p
        p*=5
print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 2 == 1:
  print(0)
else:
  M = 0
  while True:
    N //= 10
    M += N
    if N == 0:
      break
  print(M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok
#

def main():
    N=ii()
    ans = 0
    fi = 10
    while N >= fi:
        ans += N//fi
        fi *= 5
    print(ans)

main()

Submission status: Wrong Answer

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

if n % 2 == 1:
    print(0)
else:
    count = 0
    for i in range(1, 26):
        count += math.floor(n / (2 * 5 ** i))
    print(count)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
ans = 0

if N % 2 != 0:
    pass
else:
    for i in range(0, 25):
        #ans += N // (10*5**i)
        ans += math.floor(N / (10*5**i))
        

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
ans = 0

if N % 2 != 0:
    pass
else:
    div = 10
    #for i in range(0, 25):
    while div <= N:
        ans += math.floor(N / div)
        div *= 5

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
ans = 0

if N % 2 != 0:
    pass
else:
    div = 10
    for i in range(0, 25):
        ans += math.floor(N / div)
        div *= 5

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
ans = 0

if N % 2 != 0:
    pass
else:
    N /= 2
    while N > 0:
        ans += math.floor(N / 5)
        N /= 5

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
ans = 0

if N % 2 != 0:
    pass
else:
    for i in range(0, 25):
        ans += math.floor(N / (10*5**i))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N & 1:
  print(0)
else:
  count = 0
  i = 0
  while pow(5,i) <= N:
    count += N // pow(5,i)
    i += 1
  print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
list_n_ans = []
ans = []

if n % 2 == 0:
    x = n / 2
    while x >= 5:
        ans.append(int(x/5))
        x = int(x/5)

print(int(sum(ans)))

Submission status: Wrong Answer

Solution code:
n = int(input())
list_n_ans = []
ans = []

if n % 2 == 0:
    x = n / 2
    while x > 4:
        ans.append(int(x/5))
        x = int(x/5)

print(int(sum(ans)))

Submission status: Wrong Answer

Solution code:
n = int(input())
list_n_ans = []
ans = []

if n % 2 == 0:
    x = n / 2
    while x > 4:
        ans.append(int(x/5))
        x = int(x/5)

print(sum(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n % 2 == 1:
    print(0)
else:
    p = 1
    t = 10
    while t <= n:
        p += 1
        t *= 10
    s = 0
    
    for i in range(1,p):
        s += n // (10 ** i)
    print(s)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = len(str(n))
ans = np.zeros(a+4)


def calc(x, y):
    return x // (10 * 5**y)


if n % 2 == 1:
    pass
else:
    for i in range(a+4):
        ans[i] += calc(n, i)
print(sum(ans))

Submission status: Wrong Answer

Solution code:
def solve(x, keta):
    cnt = 0
    jou = 0
    while keta > 0:
        cnt += (keta-1) * (9 ** jou)
        keta -= 1
        jou += 1

    # print(x*cnt)
    return x*cnt

N = int(input())
ans = 0

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

else:
    keta = len(str(N))
    # print(keta,"\n")

    while(keta > 0):
        x = N//(10**(keta-1))
        # print(x)
        # print(keta)

        ans += solve(x, keta)

        N -= x*(10**(keta-1))
        keta -= 1
        # print()

    print(ans)

Submission status: Wrong Answer

Solution code:
from math import log2
N = int(input())
ans = 0
if(N % 2 == 0 and N != 0):
  for i in range(int(log2(N))):
    ans += (N // 5 ** (i+1)) // 2
  print(ans)
elif(N % 2 == 1):
  print(0)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
from math import log2
N = int(input())
ans = 0
if(N != 0 and N % 2 == 0):
  for i in range(int(log2(N))):
    ans += (N // 5 ** (i+1)) // 2
  print(ans)
elif(N % 2 == 1):
  print(0)
else:
  print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
if N%2 ==0 and N!=0:
    n = str(N)
    x = len(n)
    x-=1
    t = math.factorial(x)
    print(t)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
def f(n):
    d = 10
    z = 0
    while True:
        q = (n // d)
        z += q
        d = 5 * d
        if d > n:
            break
    return z

n = int(input())

if n % 1 == 1: # odd                                                                                                                                    
    print(0)
else: # even                                                                                                                                            
    ans = f(n)
    print(ans)

Submission status: Wrong Answer

Solution code:
def f(n):
    d = 10
    z = 0
    while True:
        q = (n // d)
        if q == 0:
            break
        z += q
        d = 5 * d
        if d >=	n:
            break
    return z

n = int(input())

if n % 1 == 1: # odd                                                                                                                                    
    print(0)
else: # even                                                                                                                                            
    ans = f(n)
    print(ans)

Submission status: Wrong Answer

Solution code:
def f(n):
    d = 10
    z = 0
    while True:
        q = (n // d)
        if q == 0:
            break
        z += q
        d = 5 * d
    return z

n = int(input())

if n % 1 == 1: # odd                                                                                                                                    
    print(0)
else: # even                                                                                                                                            
    ans = f(n)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 2 == 0:
    p = 10
    ret = 0

    while p < N:
        ret += N // p
        p *= 5
    
    print(ret)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
X = int(input())

if X % 2 != 0 or X < 10:
    print(0)
else:
    ans = 0
    cnt = 0
    while X > 0:
        X //= 10
        ans += X
    print(ans)