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:
from bisect import bisect_right, bisect_left
from itertools import groupby, permutations, combinations
from fractions import gcd
import numpy as np
from sys import stdin, stderr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def main():
    N = int(input())
    if N % 2 == 1:
        return 0
    d = 10
    m = 1
    ret = 0
    while d < N:
        ret += m * (N // d)
        d *= 5
    return ret


if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
ans = N // 10
N //= 10
while N > 0:
    ans += N // 5
    N //= 5
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
ans = N // 10
N //= 10
i = 1
while N > 5:
    ans += N // 5
    N //= 5
    i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
def solve():
    _N = int(input())
    N = _N
    ans = 0
    if N % 2 == 0:
        div = 5
        while N // div > 0:
            ans += N//div
            div *= 5
    print(ans)


solve()

Submission status: Wrong Answer

Solution code:
def solve():
    _N = int(input())
    N = _N
    ans = 0
    if N % 2 == 0:
        while N > 0:
            ans += N//10
            N //= 10

        tmp = "50"
        while int(tmp) < _N:
            ans += 1
            tmp += "0"

    print(ans)


solve()

Submission status: Wrong Answer

Solution code:
def solve():
    _N = int(input())
    N = _N
    ans = 0
    while N > 0:
        ans += N//10
        N //= 10

    tmp = "50"
    while int(tmp) < _N:
        ans += 1
        tmp += "0"

    print(ans)


solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
def fuc(n):
    if n < 2:
        result_num = 1
    else:
        result_num = 1

        loop_count = n // 2

        for i in range(loop_count):
            result_num *= n
            n -= 2

    div_num = 10
    while True:
        print(div_num)
        if result_num % div_num == 0:
            div_num *= 10
        else:
            break
    
    if div_num == 10:
        print(0)
    else:
        print(int(math.log10(div_num)))


fuc(n)

Submission status: Wrong Answer

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

n5 = 0

if N % 2 == 1:
  pass
else:
  for i in range(1,500):
    t = math.floor(N / ((5**i)*2))
    if t > N:
      break
    n5 += t

print(n5)

Submission status: Wrong Answer

Solution code:
N = int(input())

n5 = 0

if N % 2 == 1:
  pass
else:
  for i in range(1,30):
    if N < 5**i*2:
      break
    n5 += int(N / (5**i*2))

print(n5)

Submission status: Wrong Answer

Solution code:
N = int(input())

n5 = 0

if N % 2 == 1:
  pass
else:
  for i in range(1,50):
    n5 += int(N / (5**i*2))

print(n5)

Submission status: Wrong Answer

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

if N % 2 == 1:
  pass
else:
  for i in range(1, 10000):
    m = pow(5, i) * 2
    if m > N:
      break
    else:
      ans += int(round(N / m, 0))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
#administrasion nas
ans = 0
def g1(x,p):
    if x == 0:
        return 0
    elif x < p:
        return 0
    else:
        return  g1(x/p,p)+int(x/p)

def g2(x,p):
    if p == 2:
        return g1(x/2,2)+x/2
    else:
        return g1(x/2,p)

if N % 2 == 1:
    print(0)
else:
   ans = min(g2(N,2),g2(N,5)) 
   print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

#administrasion nas
ans = 0
def g1(x,p):
    if x == 0:
        return 0
    elif x < p:
        return 0
    else:
        return  g1(x/p,p)+int(x/p)

def g2(x,p):
    if p == 2:
        return g1(x/2,p)+int(x/2)
    else:
        return g1(x/2,p)

if N % 2 == 1:
    print(0)
else:
   ans = min(g2(N,2),g2(N,5)) 
   print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

#administrasion nas
ans = 0
def g1(x,p):
    if x == 0:
        return 0
    elif x < p:
        return 0
    else:
        return  g1(x/p,p)+int(x/p)


def g2(x,p):
    if p ==2:
        return g1(x/2,p)+x/2
    else:
        return g1(x/2,p)

if N % 2 == 1:
    print(0)
else:
   ans = min(g2(N,2),g2(N,5)) 
   print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
def eq2(y):
    c2 = 0
    while y % 2 == 0:
        c2 += 1 
        y = y // 2
    return c2
def eq5(y):
    c5 = 0
    while y % 5 == 0:
        c5 += 1 
        y = y // 5
    return c5

cc2 = 0
cc5 = 0
if n % 2 != 0:
    print(0)
else:
    for k in range(n, 1, -2):
        cc2 += eq2(k)
        cc5 += eq5(k)
print(min(cc2, cc5))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
n=n//2
i=0
f=5

while (n//f)>0:
  i+=n//f
  f=f*5

i+=n//f
print(i)

Submission status: Wrong Answer

Solution code:
n=int(input())
n=n//2
i=0
f=5

while n//f>0:
  i+=n//f
  f=f*5

print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())

n5 = 0

if N % 2 == 1:
  print(0)
else:
  for i in range(1,30):
    n5 += int(N / (5**i*2))

  print(n5)

Submission status: Wrong Answer

Solution code:
N = int(input())

n5 = 0

if N % 2 == 1:
  print(0)
else:
  for i in range(1,100):
    n5 += int(N / (5**i*2))

  print(n5)

Submission status: Wrong Answer

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

if N % 2 == 1:
  pass
else:
  ans = int(round(N/10, 0))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

print(ans)

Submission status: Wrong Answer

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

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

        num_5 = N // 5
        ans += num_5
        N = N // 5

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0
import sys
if n % 2 == 1:
  print(0)
  sys.exit()
else:
  for i in range(1, 30):
    counter += n // (2 * 5**i)
    print(2 * 5**i)
print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())

res = 0
x = 10
while n // x > 0:
    res += n // x
    x *= 5
print(res)

Submission status: Wrong Answer

Solution code:
# ABC148E - Double Factorial
def main():
    N = int(input())
    if N % 2 == 1:
        print(0)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n % 2 == 1:
    print(0)
else:
    print(sum(n // (2 * 5 ** d) for d in range(1, 18 + 1)))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
if n % 2 == 1:
    print(0)
else:
    k = 0 if n < 50 else n // sum((d - 1) * n // (2 * 5 ** d) for d in range(1, 18 + 1))
    print(n // 10 + k)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n % 2 == 1:
    print(0)
else:
    print(sum(n - 5 ** d + 1) for d in range(1, 18 + 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import floor


def main():
    result = 0
    N = int(input())
    if N % 2 == 0:
        N //= 2
        while N > 0:
            result += floor(N / 5)
            N //= 5
        print(result)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from math import floor


def main():
    result = 0
    N = int(input())
    if N % 2 == 0:
        N /= 2
        while N > 0:
            # Nは偶数，かつ5の倍数　∴10の倍数
            result += floor(N / 5)
            N = floor(N / 5)
        print(result)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from math import floor


def main():
    result = 0
    N = int(input())
    if N % 2 == 0:
        while N > 0:
            # Nは偶数，かつ5の倍数　∴10の倍数
            result += floor(N / 10)
            N = floor(N / 5)
        print(result)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
cnt = 0
if N%2==1:
    print(0)
else :
    for i in range(1,30):
      n = N//2
      cnt +=math.floor(n//5**i)
      if N < 5**i:
            break
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
cnt = 0
if N%2==1:
    print(0)
else :
    for i in range(1,30):
        cnt +=math.floor(N//5**i)
        if N < 5**i:
            break
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y


N=II()
res = 0
D = 10
while N // D:
    res += N//D
    D *= 5

if D%2:
    print(0)
else:
    print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

def solve(n):
    div = 10
    sol = 0
    term = n // div
    while term > 0:
        term = n // div
        sol += term 
        div *= 5
    return sol

print(solve(n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n % 2 == 1:
  print(0)
  sys.exit()
m = n/2
count = 0
i = 1
while m >= 5 ** i:
  count += (m // (5 ** i))
  i += 1
print(int(count))

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n % 2 == 1:
  print("0")
  sys.exit()
m = n/2
count = 0
i = 1
while m >= 5 ** i:
  count += (m // (5 ** i))
  i += 1
print(int(count))

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n % 2 == 1:
  print("0")
  sys.exit()
else:
  pass
m = n/2
count = 0
i = 1
while m >= 5 ** i:
  count += (m // (5 ** i))
  i += 1
print(int(count))

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n % 2 == 1:
  print("0")
  sys.exit()
else:
  pass
m = n/2
count = 0
i = 1
while m >= 5 ** i:
  count += m // (5 ** i)
  i += 1
print(int(count))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
N //= 2
while True:
    ans += N // 5
    N //= 5
    if N == 0:
        print(ans)
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
s = 0
dominator = 5

if N % 2 == 0:
    N //= 2
    while(N>dominator):
        s += N // dominator
        dominator *= 5

print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
dominator = 5

if N % 2 == 0:
    N //= 2
    while(N>dominator):
        sum += N // dominator
        dominator *= 5

print(sum)

Submission status: Wrong Answer

Solution code:

N = int(input())
sum = 0
dominator = 5

if N % 2 == 0:
    while(N>dominator):
        sum += N // dominator
        dominator *= 5

print(sum)

Submission status: Wrong Answer

Solution code:

N = int(input())
import math
sum = 0
dominator = 10

if N % 2 == 0:
    while(N>dominator):
        sum += math.floor(N / dominator)
        dominator *= 5

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = 0
dominator = 10

if N % 2 == 0:
    while(N>dominator):
        sum += N // dominator
        dominator *= 5

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    cnt = 0
    for i in range(1, 10 ** 20):
        md = pow(5, i) * 2
        if md <= n:
            cnt += n // md
        else:
            break
    print(cnt)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 12:54:35 2019

@author: USER
"""

n=int(input())
if n%2==1:
    print(0)
else:
    v=0
    a=0
    i=1
    while v==0:
        a=a+n//5**i
        i=i+1
        if n//5**i==0:
            v=1
    m=5*int(n/5)
    for h in range(i-1):
        if (m//(5**(h+1)))%2==0: 
            a=a-int((m//(5**(h+1)))/2)
        else:
            a=a-int((1+m//(5**(h+1)))/2)        
    print(int(a))

Submission status: Wrong Answer

Solution code:
import math
import bisect
import collections
import itertools
def gcd(a,b):return math.gcd #最大公約数
def lcm(a,b):return (a*b) // math.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def imn(): return map(int, input().split()) #整数map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i: divisors.append(n//i)
    return divisors
def is_prime(n):
    if n == 1: return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0: return False 
    return True

N = iin()
if N % 2 == 1: print(0)
cnt = 0
div = 10
while True:
    cnt += N//div
    div *= 5
    if div > N:break

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
import bisect
import collections
import itertools
def gcd(a,b):return math.gcd #最大公約数
def lcm(a,b):return (a*b) // math.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def imn(): return map(int, input().split()) #整数map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i: divisors.append(n//i)
    return divisors
def is_prime(n):
    if n == 1: return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0: return False 
    return True

N = iin()
cnt = 0
div = 10
while True:
    cnt += N//div
    div *= 5
    if div > N:break

print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 12:54:35 2019

@author: USER
"""

n=int(input())
if n%2==1:
    print(0)
else:
    a=0
    i=1
    h=1
    v=1
    u=0
    while v==1:
        a=a+n//10**i 
        i=i+1
        if n//10**i==0:
            v=0
    while u==0:
        a=a+n//((5**h)*10)
        h=h+1
        if n//(5**h)*10==0:
            u=1
    print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

from math import floor

if __name__=='__main__':
  n = int(input())

  if n%2 != 0:
    # odd
    print(0)
  else:
    # even
    count_5 = 0
    for i in range(1, 100):
      denominator = (5**i)*2
      if n < denominator:
        break
      count_5 += floor( n / denominator )
    print(count_5)

Submission status: Wrong Answer

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

from math import floor

if __name__=='__main__':
  n = int(input())

  if n%2 != 0:
    # odd
    print(0)
  else:
    # even
    count_5 = 0
    for i in range(1, 100):
      if n < pow(5, i)*2:
        break
      count_5 += floor( n / (pow(5, i)*2) )
    print(count_5)

Submission status: Wrong Answer

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

from math import floor

if __name__=='__main__':
  n = int(input())
  count_5 = 0
  for i in range(1, 100):
    if n < pow(5, i)*2:
      break
    count_5 += floor( n / (pow(5, i)*2) )

  print(count_5)

Submission status: Wrong Answer

Solution code:
N = int(input())
#= map(int,input().split())
#a =list(map(int,input().split()))
# [list(map(int,input().split())) for i in range(N)]
waru = 50
answer = N//10
if N%2 ==0:
    while N >waru:
        answer += N//waru
        waru *= 5
    print(answer)
else:
    print('0')

Submission status: Wrong Answer

Solution code:
n = int(input())
if n%2!=0 or n <10:
    print(0)
else:
    n_len = len(str(n))
    ans = 0
    for i in range(1,n_len):
        zeros = int('1'*i)
        ans += int(str(n)[-(i+1)]) * zeros
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = 0
i = 1

if n % 2 == 0:
  while 2 * (5 ** i) < n:
    a += n // (2 * (5 ** i))
    i += 1

print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n % 2 == 1:
    print(0)
    sys.exit()
x = (n // 10) + (n // 50)
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def main():

    # sys.stdin=open('input148e.txt')

    n = int(input())
    c = 0

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

    r = 10
    while r <= n:
        c += int(n / r)
        r = r * 5
    print(c) 

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

def main():

    # sys.stdin=open('input148e.txt')

    n = int(input())
    c = 0

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

    r = 10
    while r <= n:
        c += n / r
        r = r * 5
    print(c) 

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

for s in reversed(str(num)):
    if int(s) ==0:
        cnt+=1
    else:
        break 
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt =0
num=1

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt =0
num=1

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

    print(cnt)

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt =0
num=1

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

    while num%10 !=0:
        if num%10 !=0:
            break
        else:
            num = num%10
            cnt +=1
    print(cnt)

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

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt =0
num=1

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

    while num//10 !=0:
        if num%10 !=0:
            break
        else:
            num = num%10
            cnt +=1
    print(cnt)

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

Submission status: Wrong Answer

Solution code:
N = int(input())


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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

sum = n
while(n-2 > 0):
    sum = sum * (n-2)
    n -= 2

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#E-double fanctorial

def keta(n):
    x=0
    while n!=0:
        n=int(n/10)
        x+=1        
    return x

n=int(input())
ans=0
flag=True

#x: 桁数
x=keta(n)
num=[]
for i in range(1,x):
    num.append(10**i)
#print(num)
    
if (n%2==1) or int(n/10)==0:
    flag=False

if flag==False:
    ans=0
else:
    for i in num:
        ans+=int(n/i)

print(ans)

Submission status: Wrong Answer

Solution code:
import math


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

    # f(n) = 1 (n < 2)
    # f(n) = n * f(n - 2)
    # f(n) = n * (n - 2) * (n - 4) * ... * 4 * 2

    if (N % 2 == 0):
        c = 0
        a = 5
        while 2 * a <= N:
            c += math.floor(N / (2 * a))
            a *= 5
        print(c)

    else:
        print(0)


main()