qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# E - Double Factorial

N = int(input())

ans = 0
p = 10

if (N%2):
    continue
else:
    while True:
        if p > N:
            break
        ans += N // p
        p *= 5

print(ans)


Fixed code:
# E - Double Factorial

N = int(input())

ans = 0
p = 10

if (N%2==0):
    while True:
        if p > N:
            break
        ans += N // p
        p *= 5

print(ans)
Buggy 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)

Fixed code:
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))) // 2

print(ans)
Buggy 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)

Fixed 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))) // 2

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

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

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

if __name__ == "__main__":
	n = int(input())
	print(f(n))
Buggy 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)

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

Fixed code:
count=0
k=10
n=int(input())
if n%2==1:
    print(0)
else:
    for i in range(1,100):
        count+=n//(k)
        k*=5
    print(count)
Buggy code:
    
def even(n):
    count = 0
    i = 10
    while(n/i>=1):
        count += int(n/i)
        i *= 10
    return int(count)

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

    if N < 2:
        print(0)

    # even
    elif N % 2 == 0:
        print(even(N))
    # odd
    elif N % 2 == 1:
        print(0)

if __name__ == "__main__":
    main()


Fixed code:
def even(n):
    count = 0
    i = 10
    while(n/i>=1):
        count += n//i
        i *= 5
    return int(count) 

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

    if N < 2:
        print(0)

    # even
    elif N % 2 == 0:
        print(even(N))
    # odd
    elif N % 2 == 1:
        print(0)

if __name__ == "__main__":
    main()
Buggy 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)

Fixed 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(counter)
Buggy 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)

Fixed 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

print(ans)
Buggy code:
import math

N = int(input())

rep = int(math.floor(math.log(N,5)))
r=0
for i in range(rep):
  q = 5**(i+1)
  w = ((N//q)+1)//2
  r+=w

if N%2==1:
  r=0

print(r)

Fixed code:
import math

N = int(input())

if N==0:
  r=0
elif N%2==1:
  r=0
else:
  rep = int(math.floor(math.log(N,5)))
  r=0
  for i in range(rep):
    q = 5**(i+1)
    if (N//q)%2==0:
      w = (N//q)//2
    else :
      w = ((N-1)//q)//2
    r+=w


print(r)
Buggy code:
n, r = divmod(int(input()),2)
ans = 0
i = 1

if not r:
    while n >= 5**i:
        ans += n//(5**i)
        i += 1
    print(ans)

Fixed code:
n, r = divmod(int(input()),2)
ans = 0
i = 1

if not r:
    while n >= 5**i:
        ans += n//(5**i)
        i += 1
print(ans)
Buggy code:
N = int(input())
l = len(str(N))
if N < 2:
    print(0)
elif N % 2 == 1:
    print(0)
else:
    ans = 0
    tmp = 0
    for i in range(1, l+1):
        ans += (N // 10**i)
        tmp += (N // (10 * (5**i)))
        tmp -= N // (10 * (10**i))
    ans += max(tmp, 0)
    print(ans)


Fixed code:
N = int(input())
l = len(str(N))
if N < 2:
    print(0)
elif N % 2 == 1:
    print(0)
else:
    ans = 0

    for i in range(1, 2*l):
        tmp = 0
        ans += (N // 10**i)
        tmp += (N // (10 * (5**i)))
        tmp -= N // (10 * (10**i))
        ans += max(tmp, 0)

    print(ans)
Buggy 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)


Fixed code:
X = int(input())

if X % 2 != 0 or X < 10:
    print(0)
else:
    X //= 2
    ans = 0
    while X > 0:
        X //= 5
        ans += X
    print(ans)
Buggy code:
N = int(input())

count = 0
div = 10

if N % 2 == 0:
    for i in range(1, 26):
    count += N // div
    div *= 5

print(count)


Fixed code:
N = int(input())

count = 0
div = 10

if N % 2 == 0:
    for i in range(1, 26):
        count += N // div
        div *= 5

print(count)
Buggy 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)

Fixed 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)
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())

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

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

n = int(input())

if n % 2 == 1:
    print(0)
else:
    c = 1
    s = 0
    while 2 * 5**c <= n:
        s += n // (2 * 5**c)
        c += 1
    print(s)
Buggy code:
n = int(input())
if n%2 == 1:
    print(0)
else:
    counter = 0
    for i in range(1, n):
        num = n/pow(10, i)
        if num > 1:
            counter += n//pow(10, i)
        else:
            break
    print(counter)
    

Fixed code:
n = int(input())
if n%2 == 1:
    print(0)
else:
    counter = 0
    for i in range(1, n):
        num = n/pow(5, i)
        if num >= 1:
            counter += (n//pow(5, i))//2
        else:
            break
    print(counter)
Buggy code:
import sys
import math
import re
import io

def query(n, m):
    ans = 0
    while n > 0:
        ans += n // m
        n //= m
    return ans

def solve(n):
    if n < 2:
        return 0
    if n % 2 == 1:
        val = 0
        if n % 5 == 0:
            val = 1
        return query(n - 1,  5) + val
    return query(n // 2, 5)

def main():
    n = int(input())
    ans = solve(n)
    print(ans)


if __name__ == "__main__":
    main()


Fixed code:
import sys
import math
import re
import io

def query(n, m):
    ans = 0
    while n > 0:
        ans += n // m
        n //= m
    return ans

def solve(n):
    if n < 2:
        return 0
    if n % 2 == 0:
        return query(n // 2, 5)
    return 0

def main():
    n = int(input())
    ans = solve(n)
    print(ans)

if __name__ == "__main__":
    main()
Buggy code:
n = int(input())


if n%2 == 1:
    print(0)
else:
    answer = 0
    count = 1
    n=int(n/2)
    while 5**count <= n:
        answer += int(pow(n//5,count))
        count+=1
    print(answer)

Fixed code:
n = int(input())


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

Fixed code:
N = int(input())
a = 0
b = 0
n = 1
b = 2*5**(n)
if N % 2 == 1:
  print(0)
else:
  while b <= N:
    a += int(N // b)
    n += 1
    b = 2*5**(n)
  print(a)
Buggy code:
N = int(input())
if N % 2 == 1 or N < 10:
  print(0)
else:
  k = 10
  total = 0
  while N > k:
    total += N // k
    k *= 10
  print(total)

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

result = 0

if num  % 2 != 0:
    result = 0
else:
    num = num / 2
    while(num > 0):
        result += num // 5
        num = num // 5

print(result)


Fixed code:
num = int(input())

result = 0

if num  % 2 != 0:
    result = 0
else:
    num = num // 2
    while(num > 0):
        result += num // 5
        num = num // 5

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

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

if n % 2 != 0:
    ans = 0
else:
    ans = 0
    while n:
        ans += n // 5
        n //= 5

print(ans)


Fixed code:
n = int(input())

if n % 2 != 0:
    ans = 0
else:
    ans = 0
    n //= 2
    while n:
        ans += n // 5
        n //= 5

print(ans)
Buggy code:
N=int(input())
if N%2==1:
    print(0)
else:
    s=0
    for i in range(1,30):
       s+=(N//(10**i))
       s+=(N//(5*(10**i)))//2
    print(s)

Fixed code:
N=int(input())
if N%2==1:
    print(0)
else:
    s=0
    for i in range(1,30):
       s+=(N//(5**i))//2
    print(s)
Buggy 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))
 

Fixed 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,2)
  c5=fact(N//2,5)
  print(min(c2,c5))
Buggy code:
#import numpy as np
def cin():
    return map(int, input().split())


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

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

div = 1
n //= 2

for i in range(33):
    div *= 5
    cnt += n // div

print(cnt)


Fixed code:
#import numpy as np
def cin():
    return map(int, input().split())


n = int(input())

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

div = 1
n //= 2

for i in range(33):
    div *= 5
    cnt += n // div

print(cnt)
Buggy code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())

ans = 0
if N%2==1:
    print(0)
    exit(0)
for i in range(1, 20):
    cnt = N//(5**i)
    ans += int(cnt/2)
print(ans)

Fixed code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())

ans = 0
if N%2==1:
    print(0)
    exit(0)
for i in range(1, 40):
    cnt = N//(5**i)
    ans += cnt//2
print(ans)
Buggy code:
#!/usr/bin/env python

n = int(input())

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

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

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

print(ans//2)


Fixed code:
#!/usr/bin/env python

n = int(input())

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

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

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

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

Fixed code:
n = int(input())
if n % 2 != 0:
    print(0)
else:
    count = 0
    for i in range(1,len(str(n))*2):
        count += n//((5**i)*2)
    print(count)
Buggy code:
n = int(input())
if n % 2:
    print(0)
else:
    n = (n // 10) * 10
    print(n)
    ans = 0
    n = n // 10
    ans += n
    while True:
        if n < 5:
            break
        n = n // 5
        ans += n
    print(ans)


Fixed code:
n = int(input())
if n % 2:
    print(0)
else:
    n = n // 10
    ans = n
    c = 5
    while True:
        if n // c:
            ans += n // c
            c *= 5
        else:
            break
    print(ans)
Buggy code:
N=int(input())
S=2
ans=0
if N%2==1:
   print(0)
else:
   for i in range(1,26):
      ans+=N//(2*(5**i))
print(ans)

Fixed code:
N=int(input())
S=2
ans=0
if N%2==1:
   print(0)
   exit()
else:
   for i in range(1,26):
      ans+=N//(2*(5**i))
print(ans)
Buggy code:
N = int(input())
answer = 0
number = 5
if N % 2 != 0:
    print(0)
else:
    while number < N:
        answer += N // number // 2 
        number *= 5

print(answer)    


Fixed code:
N = int(input())
answer = 0
number = 5
if N % 2 != 0:
    print(0)
else:
    while number < N:
        answer += N // number // 2 
        number *= 5
    print(answer)
Buggy code:
n=int(input())
w=5
ans=0
if n%2==0:
  while w<n:
    ans+=n//w
    w=w*5
  print(ans)
else:
  print(0)

Fixed code:
n=int(input())
w=10
ans=0
if n%2==0:
  while w<=n:
    ans+=n//w
    w=w*5
  print(ans)
else:
  print(0)
Buggy code:
import math
N=int(input())
a=0
b=50
if N%2!=0:
	print(0)
else:  
	while N>=b:
		a+=N//b
		b*=5
	print(a)

Fixed code:
import math
N=int(input())
a=0
b=10
if N%2!=0:
	print(0)
else:
	while N>=b:
		a+=(N//b)
		b=b*5
	print(a)
Buggy code:
n=int(input())
a=0
if n%2==1:
    print(0)
if n%2==0:
  i=1
  while 5**i<=n:
    a+=((n//(5**i))//2)
    i+=1
print(a)


Fixed code:
n=int(input())
a=0
if n%2==1:
    print(0)
if n%2==0:
  i=1
  while 5**i<=n:
    a+=((n//(5**i))//2)
    i+=1
  print(a)
Buggy code:
n=int(input())
if n%2==1:
  print(0)
else:
  l=n//2
  k=0
  while l>=5:
    l/=5
    k+=1
  #print(k)
  c=0
  for i in range(1,k+1):
    c+=n//(2*5**i)
  print(c

Fixed code:
n=int(input())
if n%2==1 or n==0 or n==1:
  print(0)
else:
  l=n//2
  k=0
  while l>=5:
    l/=5
    k+=1
  c=0
  for i in range(1,k+1):
    c+=n//(2*5**i)
  print(c)
Buggy code:
#E
N=int(input())
ans=0
if N%2==0:
    N=N/2
else:
    N=-1
cnt=1
while cnt<=N:
    cnt*=5
    ans+=N//cnt
print(int(ans))

Fixed code:
#E
N=int(input())
ans=0
if N%2==0:
    N=N//2
else:
    N=-1
cnt=1
while cnt<=N:
    cnt*=5
    ans+=N//cnt
print(ans)
Buggy code:
N= int(input())
if N%2==1:
 print(0)
else:
 N/=2
 a=0
 i=0
 while (5**i)<=N:
  i+=1
  a+=N//(5**i)
 print(a)

Fixed code:
N= int(input())
if N%2==1:
 print(0)
else:
 a=0
 i=0
 while (5**i)*2<=N:
  i+=1
  b=(5**i)*2
  a+=(N//b)
 print(a)
Buggy code:
def calculate(n):
    if n % 2 == 1:
        return
    s1 = n // 10
    index = 1
    s2 = 0
    while (5 ** index) <= s1:
        s2 += (s1 // (5 ** index))
        index += 1
    return s1 + s2
print(calculate(int(input())))

Fixed code:
def calculate(n):
    if n % 2 == 1:
        return 0
    s1 = n // 10
    index = 1
    s2 = 0
    while (5 ** index) <= s1:
        s2 += (s1 // (5 ** index))
        index += 1
    return s1 + s2
print(calculate(int(input())))
Buggy code:
n, ans = int(input()) //10, 0
if n % 2 == 1:
	print(0)
	exit()
while n > 0:
	ans += n
	n //= 5
print(ans)

Fixed code:
n = int(input())
if n % 2 == 1:
	print(0)
	exit()
n //= 10
ans = n
while n > 0:
	n //= 5
	ans += n
print(ans)
Buggy 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)

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


Fixed 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(0)
        return
    ans = n // 10
    for i in range(1, 32):
        ans += n // (5**i*10)
    print(ans)

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

Fixed code:
N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	k = 1
	while (5**k)*2 <= N:
		ans += N // ((5**k)*2)
		k += 1
	print(ans)
Buggy code:
n=int(input())
if n%2==0:
	n=(n)//2
ans=0
f=5
while f<=n:
	ans+=n//f
	f*=5
print(ans)

Fixed code:
n=int(input())
if n%2==0:
	n=(n)//2
	ans=0
	f=5
	while f<=n:
		ans+=n//f
		f*=5
	print(ans)
else:
	print(0)
Buggy code:
n=int(input())
ans=0
if n%2==1:
  print(ans)
else:
  i=10
  while n>i:
    ans+=n//i
    i*=5
print(ans)

Fixed code:
n=int(input())
ans=0
if n%2==1:
  print(ans)
else:
  i=10
  while n>i-1:
    ans+=n//i
    i*=5
  print(ans)
Buggy 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)

Fixed 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)
Buggy code:
n = int(input())
y = 0
if n % 2 == 0:
    for i in range(1, n):
        k = (5**i) * 2
        if n >= k:
            y += n // k
        else:
            break
else:
    for i in range(1, n):
        k = (5**i)
        if n >= k:
            y += n // k - (n // k) // 2
        else:
            break
print(y)

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

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

print(ans)        


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

if n%2 == 1:
    print(0)
else:
    n //= 2
    while n > 0:
        ans += n//5
        n //= 5
    print(ans)
Buggy code:
n = int(input())
s,i = 0,10
if n%2:
  print(0)
else:
  while i<n:
    s += (n//i)
    i *= 5

print(s)

Fixed code:
n = int(input())
s,i = 0,10
if n%2:
  print(0)
else:
  while i<=n:
    s += (n//i)
    i *= 5

  print(s)
Buggy code:
n = int(input())
if n%2:print(0)
two = 0
five = 0
val = 2
while val<=n:
    two+=n//val
    val *= 2
val = 5
while val<=n:
    five +=(n//val)//2
    val *=5
print(min(two,five))

Fixed code:
n = int(input())
if n%2:print(0);exit()
two = 0
five = 0
val = 2
while val<=n:
    two+=n//val
    val *= 2
val = 5
while val<=n:
    five +=(n//val)//2
    val *=5
print(min(two,five))
Buggy code:
n = int(input())
ans = 0
if int(n) % 2 != 0:
    print(0)
else:
    ans = 0
    cnt = 10
    while True:
        if n // cnt == 0:
            break
        ans += n // cnt
        cnt = cnt * 5
print(ans)

Fixed code:
n = int(input())
ans = 0
if n % 2 != 0:
    print(0)
    exit()
else:
    ans = 0
    cnt = 10
    while True:
        if n // cnt == 0:
            break
        ans += n // cnt
        cnt = cnt * 5
print(ans)
Buggy code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
n1 = int(readline())
if n1 % 2 == 1:
    print(0)
else:
    n1 //= 2
    ans = 0
    while n:
        n1 //= 5
        ans += n1
    print(ans)

Fixed code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
p = int(readline())
if p % 2 == 1:
    print(0)
else:
    p //= 2
    ans = 0
    while p:
        p //= 5
        ans += p
    print(ans)
Buggy code:
n = int(input())
ans = 0
n //= 10
if(n%2==1):
    print(0)
else:
    while n>0 :
        ans += n
        n//=5
    print(ans)

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


Fixed code:
n = int(input())
sub = 0
if n % 2 == 1:
    print(0)
else:
    n //= 10
    sub+=n
    while n > 0:
        n //= 5
        sub+= n
    print(sub)
Buggy 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)
        

Fixed 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)
Buggy code:
n = int(input())
if n%2 = 1:
    print(0)
    exit()
else:
    i = n/2
    count = 0
    while i > 0:
        i = i//5
        count += i
    print(count)

Fixed code:
n = int(input())
if n%2 == 1:
    print(0)
    exit()
else:
    i = n//2
    count = 0
    while i > 0:
        i = i//5
        count += i
    print(count)
Buggy code:
n = int(input())
if n % 2 == 1:
    print(0)
    exit()
n //= 1
res = 0
while n > 0:
    n //= 5
    res += n
print(res)

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

if n % 2 != 0:
    ans = -1
else:
    ans = 0
    s = 10
    stop = 0
    while(not stop):
        if s > n:
            stop = 1
        else:
            ans += n // s
            s *= 5
print(ans)


Fixed code:
n = int(input())

if n % 2 != 0:
    ans = 0
else:
    ans = 0
    s = 10
    stop = 0
    while(not stop):
        if s > n:
            stop = 1
        else:
            ans += n // s
            s *= 5
print(ans)
Buggy code:
n = int(input())
if n % 2 == 0:
    print(0)
    exit(0)
cnt = 0
five = 2 * 5
while n / five > 0:
    cnt += n // five
    five *= 5
print(cnt)

Fixed code:
n = int(input())
if n % 2 == 1:
    print(0)
    exit(0)
cnt = 0
five = 2 * 5
while n // five > 0:
    cnt += n // five
    five *= 5
print(cnt)
Buggy code:
n = int(input())

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

print(ans)

Fixed code:
n = int(input())

ans = 0
i = 0
while True:
    if n%2 == 1:
        break
    i += 1
    ans += n//2//(5**i)
    if n//2//(5**i) == 0:
        break

print(ans)
Buggy code:
n = int(input())
l = len(str(n))
ans = 0
if n % 2:
  print(0)
  exit()
for i in range(1, 100):
  if i == 1:
    ans += n//10
  ans += n//(5*10**i)
print(ans)

Fixed code:
n = int(input())
l = len(str(n))
ans = 0
if n % 2:
  print(0)
  exit()
for i in range(1, 100):
  if i == 1:
    ans += n//10
  ans += n//(10*5**i)
print(ans)