Problem:


Score: 300 points

Problem Statement

As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.

Snuke, an employee, would like to play with this sequence.

Specifically, he would like to repeat the following operation as many times as possible:

For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".  
Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.

At most how many operations can be performed?

Constraints

N is an integer between 1 and 10 \ 000 (inclusive).

a_i is an integer between 1 and 1 \ 000 \ 000 \ 000 (inclusive).

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 a_3 ... a_N

Output

Print the maximum number of operations that Snuke can perform.

Sample Input 1

3
5 2 4

Sample Output 1

3

The sequence is initially {5, 2, 4}. Three operations can be performed as follows:

First, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {15, 6, 2}.

Next, multiply a_1 by 3, divide a_2 by 2 and multiply a_3 by 3. The sequence is now {45, 3, 6}.

Finally, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {135, 9, 3}.

Sample Input 2

4
631 577 243 199

Sample Output 2

0

No operation can be performed since all the elements are odd. Thus, the answer is 0.

Sample Input 3

10
2184 2126 1721 1800 1024 2528 3360 1945 1280 1776

Sample Output 3

39



Sample input:
3
5 2 4


Sample output:
3

Submission status: Accepted

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

n = int(input())
a = map(int, input().split())
count = 0
for _a in a:
    tmp = _a
    while tmp % 2 == 0:
        tmp /= 2
        count += 1
print(count)

Submission status: Accepted

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

def f(x):
    cnt = 0
    while x%2==0:
        x/=2
        cnt+=1
    return cnt

for i in range(len(a)):
    a[i] = f(a[i])
print(sum(a))

Submission status: Accepted

Solution code:
n = int(input())
ai = list(map(int, input().split()))
ans = 0
for a in ai:
    while a % 2 == 0:
        ans += 1
        a //= 2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

arr = list(map(int,input().split()))
out = 0

for num in arr:
    i = 1
    temp = num *1
    while temp%2 == 0:
        temp = temp//2
        i += 1
    out += i-1

print(out)

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
ans = 0

for n in range(N):
    a = int(A[n])
    while True:
        if a % 2 == 0:
            a = a / 2
            ans += 1
        else:
            break

print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    a = list(map(int, input().split()))
    count = 0
    for i in range(N):
        aa = a[i]
        while aa%2==0 and aa>0:
            aa = aa//2
            count += 1
    return count

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
A = [i for i in A if i % 2 == 0]
count = 0
for i in A:
    while i % 2 == 0:
        count += 1
        i //= 2
print(count)

Submission status: Accepted

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

count=0
for a in A:
    num = a
    while True:
        if num/2 == int(num/2):
            count += 1
            num = num/2
        else:
            break
print(count)

Submission status: Accepted

Solution code:
count=0
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    while True:
        if a[i] % 2 == 0:
            a[i] /= 2
            count += 1
        else:
            break
print(count)

Submission status: Accepted

Solution code:
# your code goes here
N = int(input())
nums = list(map(int,input().split()))

ans = 0
for i in range(N):
	while 1:
		if nums[i]%2 == 0:
			nums[i] = nums[i]//2
			ans += 1
		else:
			break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a_list = map(int, input().split(" "))

cnt = 0
for a in a_list:
    while True:
        if a % 2 == 1: break
        cnt += 1
        a = a / 2

print(cnt)

Submission status: Accepted

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

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

print(two)

Submission status: Accepted

Solution code:
#coding:utf-8

N = int(input())
numList = list(map(int,input().split()))

cnt = 0
for num in numList:
    while num % 2 == 0:
        num /= 2
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import bisect
n = int(input())
nums=list(map(int,input().split()))
list2 = [pow(2,x) for x in range(31)]
total = 0
for num in nums:
  if num%2 == 0:
    tmp = bisect.bisect_right(list2,num)
    for i in range(tmp,0,-1):
      if num % list2[i] == 0:
        total += i
        break
print(total)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
print(sum([len(bin(a).split('1')[-1]) for a in A]))

Submission status: Accepted

Solution code:
n = int(input())
# a = [0 for i in range(n)]
a = [int(i) for i in input().split()]

count = 0
for i in range(n):
    while 1:
        if a[i] % 2 == 0:
            a[i] /= 2
            count += 1
        else:
            break
print(count)

Submission status: Accepted

Solution code:
N=int(input())
li = map(int,input().split())

count = 0
for x in li:
    while(x % 2 == 0):
        count = count + 1
        x = x / 2

print(count)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(x) for x in input().split()]

def maxDevineNum(num):
    ans=0
    while num%2**ans==0:
        ans+=1
    return ans-1

print(sum([maxDevineNum(x) for x in a]))

Submission status: Accepted

Solution code:
N = int(input())
a = [ int(x) for x in input().split()]
ans = 0
for i in a:
    while i % 2 == 0:
        ans += 1
        i = i // 2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in input().split():
  num = int(i)
  while num % 2 == 0:
    num /= 2
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
def c_time3_or_div2(N, A):
    ans = 0  # Aの各要素の因数2の個数の和
    for a in A:
        while a % 2 == 0:
            ans += 1
            a //= 2
    return ans

N = int(input())
A = [int(i) for i in input().split()]
print(c_time3_or_div2(N, A))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

count = 0

for num in a:
    while True:
        if num % 2 == 0:
            count += 1
            num /= 2
        else:
            break
print(count)

Submission status: Accepted

Solution code:
def f(n):
    result=0
    while n%2==0:
        n=n/2
        result+=1
    return result


N=int(input())
print(sum([f(int(i)) for i in input().split(" ")]))

Submission status: Accepted

Solution code:
N=int(input())
A=[int(i) for i in input().split() ]
def f(n):
    s=n
    a=0
    while(s%2==0):
        a+=1
        s=s//2
    return a
ans=0
for i in range(N):
    ans+=f(A[i])
print(ans)

Submission status: Accepted

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

cnt=0
for ai in a:
    while(ai%2==0):
        ai//=2
        cnt+=1
print(cnt)

Submission status: Accepted

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

def two(x):
    i=0
    while True:
        if x%2==0:
            x=x//2
            i+=1
        else:
            break

    return(i)

ANS=0
for i in range(N):
    ANS+=two(A[i])

print(ANS)

Submission status: Accepted

Solution code:
import sys

cin = sys.stdin
# cin = open("in.txt", "r")


def line2N():
    return map(int, cin.readline().split())


N, = line2N()
a = list(line2N())
t = [0] * N

for i in range(N):
    while a[i] % 2 ==0:
        t[i] += 1
        a[i] //= 2

print(sum(t))

Submission status: Accepted

Solution code:
N=int(input())
answer=0
a=list(map(int,input().split()))

for i in range(N):
 while(a[i]%2==0):
  a[i]=a[i]/2
  answer+=1

print(answer)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()]

b = [len(bin(i)) - bin(i).rfind('1') - 1 for i in a]

print(sum(b))

Submission status: Accepted

Solution code:
raw_input()
a = [int(x)for x in raw_input().split()]

def f(x):
    if x % 2 == 0:
        return 1 + f(x // 2)
    return 0

print sum(f(ai) for ai in a)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
import sys, math
from sys import stdin, stdout
from collections import deque
from itertools import permutations

rem = 10 ** 9 + 7
sys.setrecursionlimit(10 ** 6)
take = lambda: map(int, stdin.readline().split())

n=input()
a=take()
ans=0
for i in a:
    p=0
    while(i%2==0):
        i/=2
        p+=1
    ans+=p
print ans

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
a = map(int, input().split())


def check(n):
    tmp = n
    cnt = 0
    while tmp % 2 == 0:
        cnt += 1
        tmp //= 2

    return cnt


print(sum([check(ai) for ai in a]))

Submission status: Accepted

Solution code:
# 整数の入力
N = int(input())
l = list(map(int, input().split(" ")))

count = 0
for i in l:
    num = i
    count_i = 0
    while True:
        if num % 2 == 0:
            num = num/2
            count_i += 1
        else:
            break

    count += count_i

print(count)

Submission status: Accepted

Solution code:
n = input()
c = 0
for i in map(int,input().split()):
  while i%2==0:
    c+=1
    i/=2
print(c)

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline())
ans = 0 
a = map(int,stdin.readline().split())
for i in a:
    j = i 
    while j%2==0:
        j/=2
        ans += 1 
print ans

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
count=0
for a in A:
    while a%2==0:
        a=int(a/2)
        count+=1
print(count)

Submission status: Accepted

Solution code:
def calc(x):
    t = 0
    while x%2 == 0:
        x /= 2
        t += 1
    return t

n = int(input())
a = map(int, input().split())
print(sum(calc(x) for x in a))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
A = [int(i) for i in input().split()]

ans = 0
for a in A:
    while True:
        if a % 2 == 1:
            break
        a //= 2
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
input()
d = list(map(int,input().split()))
a = 0
for i in range(len(d)):
	while d[i] % 2==0:
		d[i] //= 2
		a += 1

print(a)

Submission status: Accepted

Solution code:
N = int(input())

A = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
num = 0
for i in range(n):
    k = a[i]
    while k % 2 == 0:
        num += 1
        k = k // 2

print(num)

Submission status: Accepted

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

sum = 0
for num in a:
    while num%2 == 0:
        sum += 1
        num = num/2.0
print(sum)

Submission status: Accepted

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

def dev2(a):
    count = 0
    while(True):
        if a % 2 == 0:
            a = int(a/2)
            count += 1
        else:
            break
    return count
           
b = [dev2(i) for i in a]
print(sum(b))

Submission status: Accepted

Solution code:
input()
print(sum(bin(x)[::-1].index('1')for x in map(int,input().split())))

Submission status: Accepted

Solution code:
#! /usr/bin/env python3

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

res = 0

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

print(res)

Submission status: Accepted

Solution code:
'''input
10
2184 2126 1721 1800 1024 2528 3360 1945 1280 1776
'''
n = input()
arr = map(int,raw_input().split())
ans = 0
for i in range(n):
	while arr[i]%2 == 0:
		ans +=1
		arr[i] /= 2
print ans

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
res=0
for ele in a:
  while(ele%2==0):
    res+=1
    ele//=2
print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split()))
ans = 0
for a in A:
    ans += bin(a)[2:].split("1")[-1].count("0")

print(ans)

Submission status: Accepted

Solution code:
def func(a):
    ret = 0
    while a % 2 == 0:
        a //= 2
        ret += 1
    return ret


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

print(ans)

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))
N = int(input())
a = inpl()
ans = 0
for i in a:
    while i%2==0:
        ans += 1
        i = i//2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(_) for _ in input().split()]

def calc(x):
    r = 0
    while 1:
        x, d = divmod(x, 2)
        if d == 1:
            return r
        r += 1

print(sum(calc(x) for x in a))

Submission status: Accepted

Solution code:
N = int(input())
a_list = list(map(int, input().split()))

cnt = 0
for a in a_list:
    tmp = a
    while tmp % 2 == 0:
        cnt += 1
        tmp = tmp / 2

print(cnt)

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

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


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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int ,input().split()))
c = 0

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

Submission status: Accepted

Solution code:
n = int(input())
nums = list(map(int,input().split()))
ans = 0
for i in range(n):
    while True:
        if nums[i] % 2 == 0:
            nums[i] = nums[i] // 2
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
    while a%2 == 0:
        a //= 2
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
result = 0
for i in a:
	while True:
		if i%2!=0:
			break
		else:
			i/=2
			result += 1
print(result)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
n = int(input())
a = map(int, input().split())
ans = 0
for i in a:
    while i % 2 == 0:
        ans += 1
        i //= 2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
def two(n):
    r=0
    while True:
        if n%2==0:n/=2;r+=1
        else:break
    return r
b=[two(i)for i in a]
print(sum(b))

Submission status: Accepted

Solution code:
n = int(input())
lis = list(map(int,input().split()))
cou = 0
for i in range(n):
    while 1:
        if lis[i] % 2 == 0:
            lis[i] /= 2
            cou += 1
        else:
            break
print(cou)

Submission status: Accepted

Solution code:




def main():
    temp=input()
    temp=input()
    temp=list(map(int,list(temp.split(" "))))    
    
    ans=0
    for n in temp:
        while(True):
            if n%2==0:
                n/=2
                ans+=1
            else:
                break
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split(' ')))
count_two = 0
for i in A:
    flag = 0
    while flag == 0:
        if i % 2 == 0:
            i = i // 2
            count_two += 1
        else:
            flag = 1

print(count_two)

Submission status: Accepted

Solution code:
N = int(input())
list_a = list(map(int, input().split()))
cnt = 0
for a in list_a:
    while a % 2 == 0:
        cnt += 1
        a = a / 2
print(cnt)

Submission status: Accepted

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

def solve():
    n = int(input())
    al = [int(i) for i in input().split()]
    
    ans = 0
    for elem in al:
        while elem % 2 == 0:
            ans += 1
            elem //= 2
    print(ans)

if __name__=="__main__":
    solve()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    b = i
    while b % 2 == 0:
        ans += 1
        b = b//2
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


# coding: utf-8
# Your code here!
n = int(input())
print(sum([len(bin(int(i))) - bin(int(i)).rfind("1") - 1 for i in input().split()]))

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
result = 0
for a in A:
    while a % 2 == 0:
        a /= 2
        result += 1
print(result)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

l = input()
l =[ int(i) for i in l.split()]
t =  0 
for i in l :
    x = i
    while x%2==0:
        x//=2
        t+=1
print(t)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(i) for i in input().split()]
ans=0
for i in range(N):
    while(True):
        if A[i]%2==0:
            ans+=1
            A[i]=A[i]//2
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
ans = 0
for elem in a:
    tmp = elem
    while(tmp%2==0):
        tmp = tmp//2
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
def read_ints():
    return [int(c) for c in input().split()]


def count(x):
    ret = 0
    while x % 2 == 0:
        ret += 1
        x //= 2
    return ret


def main():
    input()
    xs = read_ints()
    print(sum(count(x) for x in xs))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in map(int, input().split(" ")):
    while a % 2 != 1:
        ans += 1
        a /= 2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for v in a:
    while v % 2 == 0 and v> 1:
        v //= 2
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

print(Ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
C = [0 for _ in range(len(A))]

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

print(sum(C))

Submission status: Accepted

Solution code:
N=int(input())
a=[int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
N = int(input())
src = list(map(int,input().split()))

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:


def main():
    input()
    xx = list(map(int, raw_input().split()))
    c = 0
    for x in xx:
        while x % 2 == 0:
            x /= 2
            c += 1
    print(c)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = input()
A = map(int, raw_input().split())
ans = 0
for a in A:
  while (a&1)==0:
    a >>= 1
    ans += 1
print ans

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = LI()
    r = 0
    for c in a:
        while c % 2 == 0:
            c //= 2
            r += 1
    return r


print(main())

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

n = ni()
a = na()
ans = 0
for i in a:
    while i % 2 == 0:
        i //= 2
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,collections,itertools,re,math,fractions,decimal,random,array,bisect,heapq

# decimal.getcontext().prec = 50
# sys.setrecursionlimit(10000)
# MOD = 10**9 + 7

def solve(f):
    n = f.read_int()
    a = f.read_int_list()
    ans = 0
    for ai in a:
        while ai%2 == 0:
            ans += 1
            ai /= 2

    return ans


class Reader(object):
    def __init__(self, filename=None):
        self.file = open(filename) if filename is not None else None
        self.case = 1

    def __readline(self):
        return self.file.next().strip() if self.file else raw_input()

    def next_case(self):
        self.file.next()
        self.case += 1

    def read_int(self): return int(self.__readline())
    def read_float(self): return float(self.__readline())
    def read_long(self): return long(self.__readline())
    def read_decimal(self): return decimal.Decimal(self.__readline())
    def read_str(self): return self.__readline()

    def read_int_list(self): return map(int, self.__readline().split())
    def read_float_list(self): return map(float, self.__readline().split())
    def read_long_list(self): return map(long, self.__readline().split())
    def read_decimal_list(self): return map(decimal.Decimal, self.__readline().split())
    def read_str_list(self): return self.__readline().split()

if __name__ == '__main__':
    filename = sys.argv[1] if len(sys.argv) > 1 else None
    f = Reader(filename)
    if f.file:
        while True:
            print "Case #%d\n"%f.case, solve(f)
            try:
                f.next_case()
            except StopIteration:
                break
    else:
        print solve(f)

Submission status: Accepted

Solution code:
N = int(input())
*A, = map(int, input().split())
ans = 0
for a in A:
  while a % 2 == 0:
    a //= 2
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N = read()
a = reads()

def p2(x):
  res = 0
  while x & 1 == 0:
    x = x >> 1
    res += 1
  return res

ans = sum(p2(x) for x in a)
print(ans)

Submission status: Runtime Error

Solution code:
i=input;i()
i(sum([len(bin(a&-a))-3 for a in map(int,i().split())]))

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(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))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in a:
  count += bin(i).rfind("1") - 1

print(count)

Submission status: Runtime Error

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

for i in a:
  count += bin(i).rfind("1") - 1

  print(count)

Submission status: Runtime Error

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

count = 0
for i in range(n+1):
  b = a[i].rfind(1) - 1
  count += b

print(count)

Submission status: Runtime Error

Solution code:
from decimal import Decimal
n = int(input())
a = list(map(Decimal, input().split()))
cnt = 0
hal = True
while hal:
  hal = False
  for i in range(n):
    if hal == False and a[i] % 2 == 0:
      a[i] /= 2
      hal = True
    else:
      a[i] *= 3
  if hal:
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
n=input()
s=input().split()
s = [int(i) for i in s]
sa=[]
c=0
print(s)
for i in s:
  a=s[i]
  while True:
    if a%2==0:
      c+=1
      a=a//2
    else:
      break
print(c)

Submission status: Runtime Error

Solution code:
#include <stdio.h>
int main(void){
    int n,i;
    scanf("%d",&n);
    long long a[n],ans=0;
    for(i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    for(i=0;i<n;i++){
        while(a[i]%2==0){
            a[i]+=a[i]/2;
            ans++;
        }
    }
    printf("%lld",ans);
    return 0;
}

Submission status: Runtime Error

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

fi_flg = False
res = 0
while fi_flg is False:
  twice_flg = False
  for i in range(len(a)):
    if (a[i] % 2 == 0) and (twice_flg == False):
      a[i] = int(a[i]/2)
      twice_flg = True
    else:
      a[i] = int(a[i]*3)
 
  if twice_flg is False:
    fi_flg = True
  else:
    res += 1
print(res)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  int ans = 0;
  for (int i = 0; i < N; i++){
    int A;
    cin >> A;
    while (A%2 == 0){
      ans++;
      A = A/2
    }
  }
  cout << ans << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def resolve():
    N = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in a:
        ans += prime_factorize(i).count(2)

    print(ans)

    return

resolve()

Submission status: Runtime Error

Solution code:
n=int(input())
a=[n]
count=0

for i in range(n):
    i = int(input())
    a.append(i)

for i in a:
    x = i%2
    if x != 0:
        count += 1
    else:
        continue

if count==n:
    print(0)
else:
    print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# check
cnt = 0
evens = [a for a in A if a % 2 == 0]
while len(evens) > 0:
    max_even = max(evens)
    max_even_idx = A.index(max_even)

    A = [a * 3 if ind != max_even_idx else a // 2 for ind, a in enumerate(A)]

    cnt += 1
    evens = [even * 3 if even == max_even else even // 2 for even in evens]

print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
A = sorted(map(int, input().split())) 
ans=0
A=[i for i in A if i % 2 == 0]
A.sort(reverse=True)
for i in range(10**10):
    if A[0]%2!=0:
        break
    ans+=1
    A = [n*3 for n in A]
    A=[i for i in A if i % 2 == 0]
    A[0]=A[0]/6
    A.sort(reverse=True)
    
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = sorted(map(int, input().split())) 
ans=0
A=[i for i in A if i % 2 == 0]
A.sort(reverse=True)
for i in range(10**10):
    if A[0]%2!=0:
        break
    A = [n*3 for n in A]
    A[0]=A[0]/6
    A.sort(reverse=True)
    ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
start = 0
for l in input():
    if start == 0:
        start += 1
    else:        
        l = list(map(int, input().split()))
        break
count = 0
print(l)
for i in l:
    while True:
        if i%2 == 0:
            count += 1
            i = i/2
        else:
            break
print(count)

Submission status: Runtime Error

Solution code:
import sys
n = int(input())
a = [*map(int,input().split())]
res = 0
for x in a :
	while (x % 2 == 0) :
		res += 1
		x /= 2
print (res)

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
L = list(map(int,input().split()))
L = sorted(L)
S = []
if N >= M:
  print(0)
  exit()

for i in range(M-1):
  S.append(abs(L[i+1]-L[i]))

  S=sorted(S)
print(sum(S[0:M-N]))

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
L = list(map(int,input().split()))
L = sorted(L)
S = []
if N >= M:
	print(0)
	exit()

for i in range(M-1):
	S.append(abs(L[i+1]-L[i]))
S=sorted(S)
print(sum(S[0:M-N]))

Submission status: Runtime Error

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