qyliang/CodeNanoFix huggingface dataset:
Buggy code:
def I(): return int(input())
def LI(): return list(map(int,input().split()))
##################################################
N = I()
a = [x for x in LI() if x%2==0]
ans = 0
while 1:
    if len(a)==0:
        print(ans)
        break
    print(a)
    for i,x in enumerate(a):
        if i==0:
            a[i] /= 2
    a = [x for x in a if x%2==0]
    ans += 1


Fixed code:
def I(): return int(input())
def LI(): return list(map(int,input().split()))
##################################################
N = I()
a = [x for x in LI() if x%2==0]
ans = 0
while 1:
    if len(a)==0:
        print(ans)
        break
    ans += len(a)
    for i,x in enumerate(a):
        a[i] /= 2
    a = [x for x in a if x%2==0]
Buggy code:
def ct_2(n):
  ct=0
  while n>0:
    n//=2
    ct+=1
  return ct

input()
a=list(map(int,input().split()))
ans=0
for num in a:
  ans+=ct_2(num)
print(ans)

Fixed code:
def ct_2(n):
  ct=0
  while n%2==0:
    n//=2
    ct+=1
  return ct

input()
a=list(map(int,input().split()))
ans=0
for num in a:
  ans+=ct_2(num)
print(ans)
Buggy code:
def two_division(x):
  count=0
  while x%2==0:
    count+=1
    x//=2
  return count
n=int(input())
a=list(map(int,input().split()))
ans=n-1
for i in a:
  ans+=two_division(i)
print(ans)

Fixed code:
def two_division(x):
  count=0
  while x%2==0:
    count+=1
    x//=2
  return count
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in a:
  ans+=two_division(i)
print(ans)
Buggy code:
array_length = int(input())
input_line = input().split()

array_int = list(map(int, input_line))
array_bin = list(map(bin, array_int))
array_bin_str = list(map(str, array_bin))

array_dividable = []

for i in range(0, array_length):
    if array_int[i] == 0:
        array_dividable.append(0)
    else:
        target_line = array_bin_str[i]
        count_dividable = 0
        for j in range(1, len(target_line)):
            target_char = target_line[-j]
            if target_char == '1':
                break
            elif target_char == 'b':
                break
            else:
                count_dividable += 1

        array_dividable.append(count_dividable)

if sum(array_dividable) == 0:
    print(str(array_length - 1))
else:
    print(str(array_length))



Fixed code:
array_length = int(input())
input_line = input().split()

array_int = list(map(int, input_line))
array_bin = list(map(bin, array_int))
array_bin_str = list(map(str, array_bin))

array_dividable = []

for i in range(0, array_length):
    if array_int[i] == 0:
        array_dividable.append(0)
    else:
        target_line = array_bin_str[i]
        count_dividable = 0
        for j in range(1, len(target_line)):
            target_char = target_line[-j]
            if target_char == '1':
                break
            elif target_char == 'b':
                break
            else:
                count_dividable += 1

        array_dividable.append(count_dividable)

if sum(array_dividable) == 0:
    print("0")
else:
    print(str(sum(array_dividable)))
Buggy code:
n = int(input())
l = [int(x) for x in input().split()]
s = 0
for i in range(n):
  while l[i]%2==1:
    l[i] = l[i]//2
    s += 1
print(s)

Fixed code:
n = int(input())
l = [int(x) for x in input().split()]
s = 0
for i in range(n):
  while l[i]%2==0:
    l[i] = l[i]//2
    s += 1
print(s)
Buggy code:
n = int(input())
l = list(map(int, input().split()))

for i in range(n):
  while l[i] % 2 == 0:
    count += 1
    l[i] = l[i]/2

print(count)

Fixed code:
n = int(input())
l = list(map(int, input().split()))
count = 0
for i in range(n):
  while l[i] % 2 == 0:
    count += 1
    l[i] = l[i]/2

print(count)
Buggy code:
n = int(input())
aas = list(map(int, input().split()))

r = 0
i = 1
while True:
  f = False
  for a in aas:
    if a%2 == 0:
      a /= 2
      r += 1
      f = True
  if not f:
    break
print(r)
  


Fixed code:
n = int(input())
aas = list(map(int, input().split()))

r = 0
i = 1

while True:
  f = False
  for a in aas:
    if a%2**i == 0:
      r += 1
      f = True
  if not f:
    break
  i += 1
print(r)
Buggy code:
N=input()
li = list(map(int,input().split()))

mal = 1
for i in li:
    mal = mal * i
cnt =0
while mal % 2 == 0:
    mal = mal / 2
    cnt += 1
print(cnt)

Fixed code:
N=input()
li = list(map(int,input().split()))
cnt =0
for i in li:
    while i % 2 == 0:
        i =  i / 2
        cnt += 1
print(cnt)
Buggy code:
def LI():
	return [ int(s) for s in input().split() ]
  
A = LI()

cnt = 0

for a in A:
  odd = False
  while(not odd):
    if a % 2 != 0:
      odd = True
    else:
      a = a//2
      cnt += 1
      
print(cnt)

Fixed code:
def LI():
	return [ int(s) for s in input().split() ]

N = input()
A = LI()
 
cnt = 0
 
for a in A:
  odd = False
  while(not odd):
    if a % 2 != 0:
      odd = True
    else:
      a = a//2
      cnt += 1
      
print(cnt)
Buggy code:
N = input()
nums = list(map(int, input().split()))
cnt = 0
cntlst = []
for i in range (0,N-1):
    taisyouN = nums[i]
    while taisyouN %2 == 0:
        taisyouN = taisyouN/2
        cnt = cnt+1
print(cnt)

Fixed code:
N = int(input())
nums = list(map(int, input().split()))
cnt = 0
cntlst = []
for i in range(0,N):
    taisyouN = nums[i]
    while taisyouN %2 == 0:
        taisyouN = taisyouN/2
        cnt = cnt+1
    cntlst.append(cnt)
    cnt = 0
print(sum(cntlst))
Buggy code:
def div2(n):
  i=n
  a=0
  while True:
    if i%2!=0:
      return a
    i%=2
    a+=1

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in a:
  ans+=div2(i)
print(ans)

Fixed code:
def div2(n):
  i=n
  a=0
  while True:
    if i%2!=0:
      return a
    i//=2
    a+=1

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in a:
  ans+=div2(i)
print(ans)
Buggy code:
from math import log2

N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)


if n_list != []:
    maxnum = max(n_list)
    maxnum = log2(maxnum)
    for num2 in n_list:
        for i in range(maxnum):
            if num2 % 2**(i+1) == 0:
                count+=1


print(count)

Fixed code:
from math import log2

N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)


if n_list != []:
    maxnum = max(n_list)
    maxnum = log2(maxnum)
    maxnum = int(maxnum)
    for num2 in n_list:
        for i in range(maxnum):
            if num2 % 2**(i+1) == 0:
                count+=1


print(count)
Buggy code:
N = int(input())
l = [int(i) for i in input().split()]
count = 0
total = 1
for i in l:
    total *= i
while total%2==0:
    total /= 2
    count += 1
print(count)


Fixed code:
N = int(input())
l = [int(i) for i in input().split()]
count = 0
for i in l:
    while i % 2 == 0:
        i /= 2
        count += 1
print(count)
Buggy code:
import collections
import numpy as np

def prime_factorize(n):
    a = []
    if n%2 ==1:
		a=0
      
    while n % 2 == 0:
		a.append(2)
        n //= 2
    return a

N =int(input())

a = [int(i) for i in input().split()]

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)

Fixed code:
import collections
import numpy as np

def prime_factorize(n):
	a = 0   
	while n % 2 == 0:
		a+=1
		n //= 2
	return a

N =int(input())

a = [int(i) for i in input().split()]

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

m = 1
for i in range(n):
    m = m * a[i]

i = 0
while m % 2 == 0:
    m = int(m / 2)
    i = i + 1

print(i)

Fixed code:
n = int(input())
a = list(map(int, input().split()))

m = [0]*n
for i in range(n):
    while a[i] % 2 == 0:
        a[i] = a[i] / 2
        m[i] = m[i] + 1

ans = 0
for i in range(n):
    ans = ans + m[i]

print(ans)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
ans = 0

for i in range(n):
  while a[i] % 2 == 0:
    a[i] = a[i]/2
    ans = 1
print(ans)

Fixed code:
n = int(input())
a = list(map(int, input().split()))
ans = 0
 
for i in range(n):
  while a[i] % 2 == 0:
    a[i] = a[i]/2
    ans += 1
print(ans)
Buggy code:
n=input()
l=list(map(int,input().split()))
count=0
for i in range(n):
  num=l[i]
  while num%2==0:
    count+=1
    num=num//2
print(count)

Fixed code:
n=int(input())
l=list(map(int,input().split()))
count=0
for i in range(n):
  num=l[i]
  while num%2==0:
    count+=1
    num=num//2
print(count)
Buggy code:
def solve(N, As):
    def f(n):
        c = 0
        while n % 2 == 0:
            c += 1
            n //= 2
        return c
    return sum([f(a) for a in As])


if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N))


Fixed code:
def solve(N, As):
    def f(n):
        c = 0
        while n % 2 == 0:
            c += 1
            n //= 2
        return c
    return sum([f(a) for a in As])


if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N, As))
Buggy code:
def m2p(ai):
    aii=ai
    k=0
    ra=aii%2
    while ra==0 and aii>0:
        k=k+1
        aii=aii//2
        ra=aii%2
    return k        

n=int(input())
a=list(map(int,input().split()))

m=0
for i in range(n):
    m=m+m2p(a[i])
    print(a[i],m2p(a[i]))
print(m)

Fixed code:
def m2p(ai):
    aii=ai
    k=0
    ra=aii%2
    while ra==0 and aii>0:
        k=k+1
        aii=aii//2
        ra=aii%2
    return k        

n=int(input())
a=list(map(int,input().split()))

m=0
for i in range(n):
    m=m+m2p(a[i])
#    print(a[i],m2p(a[i]))
print(m)
Buggy code:
def run(n, a):
    cnt = 0
    for i in range(n):
        while a[i] % 2 == 0:
            a[i] /= 2
            cnt += 1
    return cnt


def read_line():
    n = input().split()
    a = input().split()
    n = int(n)
    a = [int(a[i] for i in range(len(a)))]
    return (n, a)


def main():
    n, a = read_line()
    print(run(n, a))


if __name__ == '__main__':
    main()


Fixed code:
def run(n, a):
    cnt = 0
    for i in range(n):
        while a[i] % 2 == 0:
            a[i] /= 2
            cnt += 1
    return cnt


def read_line():
    n, = input().split()
    a = input().split()
    n = int(n)
    a = [int(a[i]) for i in range(n)]
    return (n, a)


def main():
    n, a = read_line()
    print(run(n, a))


if __name__ == '__main__':
    main()
Buggy code:
N = int(input())
a = list(map(int, input().split()))

def cnt(n):
    return format(n, 'b')[::-1].find('1')

sum(list(map(cnt, a)))

Fixed code:
N = int(input())
a = list(map(int, input().split()))

def cnt(n):
    return format(n, 'b')[::-1].find('1')

print(sum(list(map(cnt, a))))
Buggy code:
def num_divide_two(num: int):
    return int(format(num, 'b')[::-1].find("1"))

N = int(input())
print(sum(map(num_divide_two, map(int, input().split())))

Fixed code:
def num_divide_two(num: int):
    return int(format(num, 'b')[::-1].find("1"))

N = int(input())
print(sum(map(num_divide_two, map(int, input().split()))))
Buggy code:
# -*- coding:utf-8 -*-
def check(num):
    if num%2:
        return 0
    else:
        return 1

def process(num):
    if num == 2:
        return num*3
    else:
        return int(num/2)

if __name__ == "__main__":
    n = int(input())
    a = [ tmp for tmp in list(map(int, input().split())) if check(tmp) ]
    ans = 0
    while(len(a)):
        a = [ tmp for tmp in list(map(process, a)) if check(tmp) ]
        ans += 1
    print(ans)

Fixed code:
# -*- coding:utf-8 -*-
def check(num):
    if num%2:
        return 0
    else:
        return 1

def process(num):
    count = 0
    while(num%2 == 0):
        num //= 2
        count += 1
    return count

if __name__ == "__main__":
    n = int(input())
    a = list(map(process, [ tmp for tmp in list(map(int, input().split())) if check(tmp) ]))
    ans = sum(a)
    print(ans)
Buggy code:
n=int(input())
l=list(map(int, input().split()))

z=[]
for i in range(n):
    x,y=0,l[i]
    while y%2==0:
        x+=1
        y=y//2
    else:
        z.append(x)
        break

print(sum(z))

Fixed code:
n=int(input())
l=list(map(int, input().split()))

z=[]
for i in range(n):
    x,y=0,l[i]
    while y%2==0:
        x+=1
        y=y//2
    else:
        z.append(x)

print(sum(z))
Buggy code:
import sys
import numpy as np


def main():
  scan = sys.stdin.readline
  
  n = int(scan().rstrip())
  a = np.array(tuple(int(a_i) for a_i in scan().rstrip().split()))
  
  print(np.sum(np.log2(a & -a)))


if __name__ == "__main__":
  main()
  

Fixed code:
import sys
import numpy as np


def main():
  scan = sys.stdin.readline
  
  n = int(scan().rstrip())
  a = np.array(tuple(int(a_i) for a_i in scan().rstrip().split()))
  
  print(int(np.sum(np.log2(a & -a))))


if __name__ == "__main__":
  main()
Buggy code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    ans = 0
    for a in A:
        if a%2 == 0:
            ans += 1

    print((ans**2)//2+ans-1)

if __name__ == '__main__':
    main()


Fixed code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    tmp = []
    for a in A:
        if a % 2 == 0:
            tmp.append(a)

    ans = 0
    for n in tmp:
        while n % 2 == 0:
            ans += 1
            n //= 2

    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
n=int(input())
a=[int(i) for i in input().split()]
count=0
for ai in a:
    if ai%2==0:
        while ai!=1:
            ai/=2
            count+=1
print(count)

Fixed code:
n=int(input())
a=[int(i) for i in input().split()]
count=0
for ai in a:
        while ai%2==0:
            ai=ai/2
            count+=1
print(count)
Buggy code:
def count(n):
  p=0
  while n%2==0:
    p+=1
  return(p)

n=int(input())
l=list(map(int,input().split()))
count=0
for i in range(n):
  count+=count(l[i])
print(count)

Fixed code:
def count(n):
  p=0
  while n%2==0:
    p+=1
    n=n//2
  return(p)

n=int(input())
l=list(map(int,input().split()))
sum=0
for i in range(n):
  sum+=count(l[i])
print(sum)
Buggy code:
N = int(input())
A = list(map(int, input().split()))

s = 1
ans = 0
for a in A:	
	while a % 2 == 0:
		a = a // 2
		ans += 1
	print(ans)

Fixed code:
N = int(input())
A = list(map(int, input().split()))

s = 1
ans = 0
for a in A:	
	while a % 2 == 0:
		a = a // 2
		ans += 1
print(ans)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]==a[i]//2
  m+=a[i]
print(m)

  


Fixed code:
n=int(input())
a=list(map(int,input().split()))
m=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]//2
    m+=1
print(m)
Buggy code:
N = int(input())
a = map(int,input().split())
k = 1
for i in a:
    k*=i
l = 0
while k%2 == 0:
    l += 1
    k /= 2
print (l)


Fixed code:
N = int(input())
a = map(int,input().split())
k = 0
for i in a:
    while i%2 == 0:
        k+=1
        i/=2
print(k)
Buggy code:
n = int(input())
A = input().split()
print(A)

count = 0
for i in range(len(A)):
    while(int(A[i]) % 2 == 0):
        count += 1
        A[i] = int(A[i])/2
print(count)


Fixed code:
n = int(input())
A = input().split()

count = 0
for i in range(len(A)):
    while(int(A[i]) % 2 == 0):
        count += 1
        A[i] = int(A[i])/2
print(count)
Buggy code:
N=int(input())
A=list(int, input().split())
counter=[]
for num in range(N):
  counter.append(0)
for num in range(N):
  while A[num]%2=0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))
  

Fixed code:
N=int(input())
A=list(map(int, input().split()))
counter=[]
for num in range(len(A)):
  counter.append(0)
for num in range(len(A)):
  while A[num]%2==0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))
Buggy code:
N = int(input())
A = list(map(int,input().split()))
cnt = 0

for i in range(N):
  while A[i]%2 == 0:
    cnt += 1

print(cnt)
    

Fixed code:
N = int(input())
A = list(map(int,input().split()))
cnt = 0
 
for i in range(N):
  while A[i]%2 == 0:
    A[i] = A[i]/2
    cnt += 1
    
print(cnt)
Buggy code:
N = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(N):
  odd = 0
  if a[i] % 2 != 0:
    odd += 1
  else:
    ans += 1
  if odd == len(a):
    break
print(ans)

Fixed code:
N = int(input())
a = list(map(int, input().split()))
ans = 0
while True:
	odd = 0
	for i in range(N):
		if a[i] % 2 != 0:
			odd += 1
		else:
			a[i] /= 2
			ans += 1
	if odd == len(a):
		break
print(ans)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

count = 0

for i in a:
    while i % 2 == 0:
        i //= 2
        count += 1
    print(i)

print(count)

Fixed code:
n = int(input())
a = list(map(int, input().split()))

count = 0

for i in a:
    while i % 2 == 0:
        i //= 2
        count += 1

print(count)
Buggy code:
n = int(input())
a = [int(i) for i in input().split()]

a = sorted(list(filter(lambda x : (x % 2) == 0, a)), reverse=True)
ans = 0
for i in a:
    ans += i / 2
print(int(ans))

Fixed code:
n = int(input())
a = [int(i) for i in input().split()]

a = sorted(list(filter(lambda x : (x % 2) == 0, a)), reverse=True)
ans = 0
for i in a:
    while i % 2 == 0:
        i //= 2
        ans += 1
print(int(ans))
Buggy code:
print(sum(list(map(lambda n: len(bin(n)) - len(bin(n).rstrip("0")), list(map(int, input().split()))))))

Fixed code:
_ = input()
print(sum(list(map(lambda n: len(bin(n)) - len(bin(n).rstrip("0")), list(map(int, input().split()))))))
Buggy code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for v in a:
    while a%2 is 0:
        ans += 1
        a /= 2
print(ans)

Fixed code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for v in a:
    while v%2 == 0:
        ans += 1
        v /= 2
print(ans)
Buggy code:
def hoge(num):
  for i in range(num):
    if(num % (2 * i) != 0):
      return i
n = int(input())
print(sum(list(map(lambda x: hoge(int(x)), input().split()))))


Fixed code:
def hoge(num):
  for i in range(10**10):
    if(num % (2 ** i) != 0):
      return i - 1
    
n = int(input())
print(sum(list(map(lambda x: hoge(int(x)), input().split()))))
Buggy code:
import numpy as np
N = int(input())
a = list(map(int,input().split()))
ans = 0
a = np.array(a)
while a.size > 0:
    a = a[a%2 == 0]
    ans += len(a)
    a = a//2
    print(a)
    print(ans)
print(ans)

Fixed code:
import numpy as np
N = int(input())
a = list(map(int,input().split()))
ans = 0
a = np.array(a)
while a.size > 0:
    a = a[a%2 == 0]
    ans += len(a)
    a = a//2
print(ans)
Buggy code:
N = int(input())
List = input()
import re

Shift = re.split(" ",List)
Ctr = 1
Wlist = []


while True:
    if Ctr > N:
        break
    Xn = 1
    while True:
        DW = int(Shift[Ctr-1])
        if DW % (2*Xn) != 0:
            break
        else:
            Xn += 1
    Wlist.append(Xn-1)
    Ctr += 1

print(sum(Wlist))

Fixed code:
N = int(input())
List = input()
import re

Shift = re.split(" ",List)
Ctr = 1
Wlist = []


for Ctr in range(1,N+1):
    Xn = 1
    DW = int(Shift[Ctr-1])
    while True:
        if DW % (2**Xn) != 0:
            break
        else:
            Xn += 1
    Wlist.append(Xn-1)
    Ctr += 1

print(sum(Wlist))
Buggy code:
# coding=utf-8

if __name__ == '__main__':
    N = int(input())
    lia = list(map(int, input().split()))

    C = 0
    for i in range(N):
        if lia[i] % 2 ==0:
            C += lia[i] / 2

    print(int(C))

Fixed code:
# coding=utf-8

if __name__ == '__main__':
    N = int(input())
    lia = list(map(int, input().split()))

    C = 0
    for i in range(N):
        if lia[i] % 2 ==0:
            tmp = lia[i]
            while tmp % 2 ==0:
                tmp = tmp / 2
                C += 1

    print(int(C))
Buggy code:
N = input()
a = input()
a = a.split()
L = len(a)
b = []
ans = 0
flag = 1
for i in range(L):
    b.append(int(a[i]))
while(flag):
    for i in range(L):
        flag = 0
        if(b[i] % 2 == 0):
            ans = ans + 1
            b[i] = b[i] / 2
            flag = 1
print(ans)


Fixed code:
N = input()
N = int(N)
a = input()
a = a.split()
L = len(a)
b = []
ans = 0
flag = 1
for i in range(L):
    b.append(int(a[i]))
while(flag):
    flag = 0
    for i in range(N):
        if(b[i] % 2 == 0):
            ans = ans + 1
            b[i] = b[i] / 2
            flag = 1
print(ans)
Buggy code:
n = int(input())
a = input().split()
aa = [int(a[i]) for i in range(n)]
b = 1
for i in range(n):
  s = list(str(aa[i]))
  ss = int(s[-1])
  if ss == 0 or ss == 2 or ss == 4 or ss == 6 or ss == 8:
  	b = b * aa[i]

print(b)
c = 0
cnt = 0
while c < 1:
  if b % 2 == 0:
    b = b // 2
    cnt = cnt + 1
  else:
    c = 1
print(cnt)

Fixed code:
n = int(input())
a = input().split()
aa = [int(a[i]) for i in range(n)]
b = 1
for i in range(n):
  s = list(str(aa[i]))
  ss = int(s[-1])
  if ss == 0 or ss == 2 or ss == 4 or ss == 6 or ss == 8:
  	b = b * aa[i]

c = 0
cnt = 0
while c < 1:
  if b % 2 == 0:
    b = b // 2
    cnt = cnt + 1
  else:
    c = 1
print(cnt)
Buggy code:
N = int(input())
A = list(map(int, input().split()))

A = sorted(A)
A = [i for i in A if i % 2 == 0]

a = 0
cnt = 0


while True:
    A = [i / 2 for i in A]
    a += 1
    print(A)
    cnt += a*len([i for i in A if i % 2 == 1])

    if len([i for i in A if i > 1]) == 0:
        break
    A = [i for i in A if i % 2 == 0]
print(cnt)


Fixed code:
N = int(input())
A = list(map(int, input().split()))

A = sorted(A)
A = [i for i in A if i % 2 == 0]

a = 0
cnt = 0


while True:
    A = [i / 2 for i in A]
    a += 1
    cnt += a*len([i for i in A if i % 2 == 1])

    if len([i for i in A if i > 1]) == 0:
        break
    A = [i for i in A if i % 2 == 0]
print(cnt)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(a):
    x=0
    while x==0:
        if a[i]%2!=0:
            x=1
        else:
            s+=1
            a[i]/=2
print(s)
         

Fixed code:
n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(len(a)):
    x=0
    while x==0:
        if a[i]%2!=0:
            x=1
        else:
            s+=1
            a[i]/=2
print(s)
Buggy code:
N = int(input())
a = list(map(int, input().split()))
m = 1
ans = 0
 
for i in range(N):
  m *= a[i]
  
  
while m % 2 == 0:
  m /= 2
  ans += 1
    
print(ans)

Fixed code:
N = int(input())
a = list(map(int, input().split()))
m = 1
ans = 0

for i in range(N):
  while a[i] % 2 == 0:
    a[i] /= 2
    ans += 1
    
print(ans)
Buggy code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 0
    for i in A:
        while i%2 == 0:
            ans += 1
            i = i//2
    print(ans)

Fixed code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 0
    for i in A:
        while i%2 == 0:
            ans += 1
            i = i//2
    print(ans)
resolve()
Buggy code:
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = ans + (len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Fixed code:
import math
n = input()
a = list(map(int, input().split()))
ans = 0
for i in a:
    ans = ans + (len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))