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:
n=int(input())
a=list(map(int, input().split()))
b=[0]*n
for j in range(40):
    for i in range(0,n):
        if a[i]%2==0:
            b[i]=b[i]+1
            a[i]=a[i]/2
        else:
            b[i]=b[i]
            a[i]=a[i]
print(sum(b))

Submission status: Accepted

Solution code:
# Q_C
N = int(input())
a = list(map(int, input().split()))
d = [0] * N

result = 0
for i in range(N):
    tmp = a[i]
    while True:
        if tmp % 2 == 0:
            result += 1
            tmp = tmp // 2
        else:
            break

print(result)

Submission status: Accepted

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

# スペース区切りの整数の入力
N = int(input())
an = list(map(int, input().split()))

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

    sum_cnt += cnt

print(sum_cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(int(i) for i in input().split())

ans = 0
for i in range(N):
    for j in range(A[i]):
        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 = list(map(int, input().split()))
count = 0
for a in a_list:
    c = 0
    while True:
        if a % 2 == 0:
            a = int(a/2)
            c += 1
        else:
            count += c
            break
print(count)

Submission status: Accepted

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

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:
        count += 1
        a[i] /= 2
print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 16 21:57:11 2018

@author: ashida
"""

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

count = 0

for i in range(N):
    tmp = a[i]
    while tmp > 1 and tmp%2 == 0 :
        tmp = tmp//2
        count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split(" ")))
ans=0
for a in A:
    ans += len(bin(a)) - bin(a).rfind("1") -1
print(ans)

Submission status: Accepted

Solution code:
count = 0
N = int(input())
L = list(map(int,input().split( )))

for n in range(N):
    for l in range(L[n]):
        if L[n]%2 == 0:
            L[n] /= 2
            count += 1
        else:
            break
            
print(count)

Submission status: Accepted

Solution code:
N = int(input())
lst = list(map(int, input().split()))
lst2 = []
def f(X):
    if X % 2 != 0:
        return 0
    return f(X / 2) + 1
for i in lst:
    lst2.append(f(i))
print(sum(lst2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
a = map(int, raw_input().split())
number = 0

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

Submission status: Accepted

Solution code:
def is_even(a):
    return [ai%2 == 0 for ai in a]

def extract_2(ai):
    n = 0
    while ai % 2 == 0:
        ai /= 2
        n += 1
    return n

N = int(raw_input())
a = [int(s) for s in raw_input().split()]

any_even = is_even(a)

evens = [extract_2(a[i]) for i in range(N) if any_even[i]]
print sum(evens)

Submission status: Accepted

Solution code:
def count(tmp_N):
    count = 0
    while True:
        if tmp_N % 2 == 0:
            tmp_N = tmp_N / 2
            count += 1
        else:
            break
    return count


N = int(input())
input_list = list(map(int, input().split(' ')))

result = 0

for input_tmp in input_list:
    result += count(input_tmp)

print(int(result))

Submission status: Accepted

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

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

print(sum([soinnsuu(i) for i in a if i%2==0]))

Submission status: Accepted

Solution code:
n=int(input())
a=0
l=[int(i) for i in input().split()]
for i in l:
  t=2
  while t <=i:
    if i%t !=0:
      break
    else:
      a+=1
      t*=2
print(a)

Submission status: Accepted

Solution code:
N = int(input().strip())
 
A = list(map(int, input().strip().split()))
 
c = 0
if not all([a // 2 == 1 for a in A]):
  binA = [bin(a) for a in A]
  for a in binA:
    c += len(a) - a.rindex('1') - 1
print(c)

Submission status: Accepted

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

#偶数のaだけ取り出す
a_even = []
for a in a_list:
	if a % 2 == 0:
		a_even.append(a)

times = 0

while len(a_even) > 0:
	a_even[0] /= 2
	times += 1

	if a_even[0] % 2 == 1:
		a_even.pop(0)

print(times)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(0,N):
    while (a[i]%2) == 0:
        a[i] /= 2
        sum += 1
print (sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

cnt = 0


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

print(cnt)

Submission status: Accepted

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



def count_even(a):
    if a % 2 == 1:
        return 0
    else:
        if a == 2:
            return 1
        return 1 + count_even(a/2)


cnt = 0

for a in l:
    cnt += count_even(a)


print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
input()
a = np.array(list(map(int, input().split())))
a = np.delete(a, np.where(a%2==1))
cont = 0
while len(a) > 0:
    cont += 1
    a[0] /= 2
    if a[0] % 2 == 1:
        a = np.delete(a, 0)
print(cont)

Submission status: Accepted

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

counter = 0

for a in A:
    while a%2 == 0:
        a /= 2
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
import math

n = int(input())

array = [int(x) for x in input().split()]

res = 0
for i in array:
    if i %2 == 0:
        while True:
            res += 1
            i /= 2
            if i % 2 != 0:
                break
print(res)

Submission status: Accepted

Solution code:
N = (int)(input())
stex = input().split()
suu = []
for i in stex:
    suu.append((int)(i))
count = 0
for c in suu:
    unti = True
    while(unti):
        if(c%2 == 0):
            c = c/2
            count = count + 1
        else:
            unti = False
print(count)

Submission status: Accepted

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

def cal(x,ans):
    if len(x) == 0 :
        print(ans)
        return ans
    else :
        y = [i for i in x if i %2 == 0]
        for i in range(len(y)):
            y[i] /= 2.0
        ans += len(y)
        cal(y, ans)


cal(a,0)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
inp2 = input()
a = inp2.split()
count = 0
for i in range(int(N)):
	b = int(a[i])
	flag = True
	c = b
	while flag:
		c = c/2
		if c.is_integer():
			count+=1
		else:
			flag = False

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
l = list(map(int, input().split()))
sum = 0
for i in range(N):
    while(l[i]%2==0):
        l[i]=int(l[i]/2)
        sum+=1
print(sum)

Submission status: Accepted

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

sum = 0

for i in range(len(l)):
    while l[i] & 1 == 0:
        l[i] = l[i] >> 1
        sum += 1

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
def log_two(x):
	i = 0
	while x % 2 == 0:
		x //= 2
		i += 1
	return i

for a in A:
	ans += log_two(a)

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):
        count += 1
        a = a // 2
print(count)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(_) for _ in input().split()]
ans = 0
for i in a:
  j = str(bin(i))
  ans += len(j)-int(j.rfind('1'))-1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#入力
N = int(input())
ip = input().split()
a =[]
for i in range(N):
    a.append(int(ip[i]))
f = []

#aの要素の素因数2の数を調べる
for x in a:
    #カウンター
    c = 0
    while x%2 == 0:
        c += 1
        x /= 2
    f.append(c)

#素因数2の数の合計を出力
print(sum(f))

Submission status: Accepted

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

for i in range(len(a)):
    if a[i]%2 == 0:
        a[i] = int(a[i]/2)
        cnt += 1
    else:
        a[i] = 0

while len(a) != a.count(0):
    for i in range(len(a)):
        if a[i]%2 == 0 and a[i] != 0:
            a[i] = int(a[i]/2)
            cnt += 1
        else:
            a[i] = 0

print(cnt)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

cnt = 0

for a in A:
	itemCnt = 0
	while a % 2 == 0:
		a /= 2
		itemCnt += 1

	# print( str(a) + "=" + str(itemCnt))
	cnt += itemCnt

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def num_divisions(num):
    for i in range(1+num):
        if num % 2**i == 0:
            pass
        else:
            return i - 1
        
        
N = int(input())
A = list(map(int, input().split()))

cnt = 0
for a in A:
    cnt += num_divisions(a)
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
list = [int(i) for i in input().split()] 
  
count = 0
  
for j in range(N):
  flag = True
  num = list[j]
  while(flag == True):
    if num % 2 == 0:
      num /= 2
      count += 1
    else:
      flag = False
      
print(count)

Submission status: Accepted

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

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

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

print(c)

Submission status: Accepted

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

for i in range(N):
    b = A[i]
    while(True):
        if b %2 ==0:
            a += 1
            b //= 2
        else:
            break          
            
print(a)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
n =  input()
str = input()

arr = str.split(" ")

count = 0

for a in arr:
    tmp = int(a)
    while(tmp%2 == 0):
        count += 1
        tmp = tmp/2

print(count)

Submission status: Accepted

Solution code:
n = int(input()) 
t = [int(i) for i in input().split()]
counter = 0
for num in t:
    while num%2 == 0:
        counter += 1
        num = num//2
print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_=input();print(sum(map(lambda x:(bin(int(x))[:2:-1]+"1").index("1"),input().split())))

Submission status: Accepted

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


res = 0
for n in a:
  while True:
    n,r = divmod(n, 2)
    if r != 0:
      break
    res += 1

print(res)

Submission status: Accepted

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

N = int(input())
A = list(map(int, input().split()))
B = sorted([x for x in A if x % 2 == 0])
cnt = 0
for i in B:
    while i % 2 == 0:
        i //= 2
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in 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:

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

def dewaru(a):
    num = a
    ans = 0
    while(1):
        if(num%1!=0):
           break
        num=num/2
        ans+=1
        
    return ans-1
    
print(sum(map(dewaru,b)))

Submission status: Accepted

Solution code:
def div_num(n):
  n = int(n)
  ret = 0
  while not n % 2:
    n //= 2
    ret += 1
  return ret

n = int(input())
print(sum(map(div_num, input().split())))

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input())
aa = [int(x) for x in input().split()]

count = 0

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

print(count)

Submission status: Accepted

Solution code:
#!/bin/python

import os
import sys

def solution(N, A):
    res = 0
    sumTemp = -1
    while sumTemp != 0:
        sumTemp = 0
        for i in range(N):
            if A[i]%2 == 0:
                A[i] /= 2
                sumTemp += 1
        res += sumTemp
    return res

if __name__ == '__main__':
    N = int(raw_input())
    A = raw_input().split()
    for i in range(N):
        A[i] = int(A[i])
    result = solution(N,A)

    print str(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

print("{}".format(ans))

Submission status: Accepted

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

count = 0
for a in ai:
    m = 1
    while (1 << m) <= a:
        if a % (1 << m) == 0:
            # print(a, 1 << m)
            count += 1
        else:
            break
        m += 1
print(count)

Submission status: Accepted

Solution code:
def counter(value):
    count = 0
    while value % 2 == 0:
        count += 1
        value /= 2

    return count

n = int(input())

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

count = 0

for i in range(n):
    if a[i] % 2 == 0:
        count += counter(a[i])
        
print(count)

Submission status: Accepted

Solution code:
N = input()
nlists = list(map(int, input().split()))
count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lists = list(map(int,input().split()))
count = 0

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

Submission status: Accepted

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

count = 0
while len(aN) > 0:
    tmp = list()
    for ai in aN:
        if ai % 2 == 0:
            ai = ai / 2
            count += 1
            tmp.append(ai)
    aN = tmp

print(count)

Submission status: Accepted

Solution code:

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

counter = 0
for a in A:
    tmp = a
    while True:
        if tmp == 0:
            break
        elif tmp % 2 == 0:
            counter += 1
            tmp = tmp // 2
        else:
            break


print(counter)

Submission status: Accepted

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

fil = list(filter(lambda x: x % 2 == 0, lis))


def soinsuu(giv):
    co = 0
    while True:
        if giv % 2 == 1:
            break
        giv /= 2
        co += 1

    return co


count = 0
for i in fil:
    import math
    count += int(soinsuu(i))
print(count)

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
la=list(map(int,input().split()))
lan=np.array(la)
count=0
while(1):
    if(np.any(lan%2==1)):
        lan=lan[~(lan%2==1)]
    if(np.any(lan%2==0)):
        lan=lan/2
        count=count+len(lan)
    else:
        break;
print(count)

Submission status: Accepted

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
counter = 0
for a in a_list:
   a_bin = bin(a)
   counter += len(a_bin) - a_bin.rfind('1') - 1
print(counter)

Submission status: Accepted

Solution code:
#*3 or /2
N = int(input())
a = list(map(int,input().split()))
ans = []
count = 0
for i in range(N):
	while(1):
		if  a[i]%2 == 0:
			a[i] = a[i]/2
			count += 1
		else:
			break

print(count)

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):
      cnt += 1
      a[i] /= 2
print(cnt)

Submission status: Accepted

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

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

i=int(0)
x=int(0)

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

print(i)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
input()
xs = [int(x) for x in input().split()]
o = 0

for x in xs:
    while not(x % 2):
        x //= 2
        o += 1

print(o)

Submission status: Accepted

Solution code:
N = input()
ans = 0
for a in map(int, input().split()):
    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 n in a:
	while ((n%2)==0):
			ans += 1
			n = n/2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0
for a_int in a:
    a_int = int(a_int)
    count = 0
    flag = 0
    while flag == 0:
        if a_int % 2 == 0:
            a_int = a_int / 2
            count += 1
        else:
            flag = 1
            break
    sum += count
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())                                       
L = list(map(int, input().split()))
res = 0
for i in range(N):
    for j in range(30):
        if L[i]%(2**(30-j)) == 0:
            res += 30-j
            break
print(res)

Submission status: Accepted

Solution code:
def prime(x):
    c = 0
    while x%2 == 0:
        x = x/2
        c += 1
    return c
n = int(input())
nums = input().split()
c = 0
for i in nums:
    c += prime(int(i))
print(c)

Submission status: Accepted

Solution code:
N=int(input())
a=list((input().split()))
import sys
i=0
count=0
data= int(a[i])

while i<len(a):
    if data%2==0:
        data=data/2
        count+=1
    if data%2!=0:
        i+=1
        if i==len(a):
            print(count)
            sys.exit()
        data=int(a[i])

Submission status: Accepted

Solution code:
N = int(input())
seq = [int(x) for x in input().split()]
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stderr
from functools import reduce
from operator import add
from math import log2
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add,repr(x)).strip("()\',")+'\n')

n = int(input())
a = f()
ans = 0

for i in a:
    if i == 2:
        ans += 1
        continue
    for j in range(int(log2(i)),0,-1):
        if i % 2**j == 0:
            ans += j
            break
        else:
            pass

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputN = int(input())

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

counter = 0

for i in range(inputN):
    while input[i] % 2 == 0:
        input[i] /= 2
        counter += 1

print (counter)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
l=input().split()
sum=0
for i in l:
    x=int(i)
    while x%2==0:
        x=x/2
        sum=sum+1
print(sum)

Submission status: Accepted

Solution code:
input()
s=input().split()
res=0
for i in s:
 i=int(i)
 while True:
  if i%2==0:
   res+=1
   i//=2
  else:
   break
print(res)

Submission status: Accepted

Solution code:
def main():
    """
    1 <= N <= 10^4
    1 <= ai <= 10^9
    """
    N = int(input())
    A = map(int, input().split())

    ans = f(N, A)
    print(ans)


def f(N, A):
    """
    以下の操作をできるだけ多くの回数繰り返す

    1 ≤ i ≤ N を満たす全ての i に対して,
    どちらかを行う.  
        ai の値を 2で割る
        aiの値を 3倍する
    ただし,
        全ての i に対して 3倍することはできず
        操作後の aiの値は整数でなければならない


    2の倍数でなければ2で割れない
    2で割って奇数になった場合、その後は3倍にしかできない
    操作後の数値上限はないので、1つでも2で割れれば良い
    """
    ans = sum(p(a) for a in A)

    return ans


def p(a):
    ans = 0
    while a > 0:
        if a % 2 == 0:
            ans += 1
            a //= 2
        else:
            break
    return ans


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
a=map(int,input().split())
a=list(a) 
import numpy as np
count_list=[0]*N
def gcd(a,b):
    c=np.floor(a/b)
    return a-b*c
for i in range(len(a)):
    while gcd(a[i],2)==0:
        count_list[i]+=1
        a[i]=a[i]/2

print(sum(count_list))

Submission status: Accepted

Solution code:
#coding: utf-8

def check(a):
    result = 0
    for o in a:
        while True:
            if o % 2 == 0:
                o = o / 2
                result += 1
            else:
                break
    
    return result


if __name__ == "__main__":
    n = int(input())
    tmp = input().split(" ")
    a = []
    for i in range(n):
        a.append(int(tmp[i]))
    
    print(check(a))

Submission status: Accepted

Solution code:
#encoding:utf-8

def evennum(number):
    count=0
    while(1):
        if number%2==1:
            break
        else:
            number=number/2
            count+=1
    return count
#input
n=int(input())

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

count=0

for i in range(n):
    count+=evennum(l[i])

print(count)

Submission status: Accepted

Solution code:
# https://abc100.contest.atcoder.jp/tasks/abc100_c


def even_count(v):
    if v % 2 != 0:
        return 0
    else:
        r = 0
        while v % (2 ** 20) == 0:
            r += 20
            v //= (2 ** 20)

        while v % (2 ** 10) == 0:
            r += 10
            v //= (2 ** 10)

        while v % 2 == 0:
            r += 1
            v //= 2

    return r


N = int(input())

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

count = 0

for i in a:
    count += even_count(i)

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def soinsuubunkai(listdata):
    cnt = 0
    for i in listdata:
        while True:
            if i % 2 == 0:
                cnt += 1
                i /= 2
            else:
                break
    return cnt

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

print(soinsuubunkai(a))

Submission status: Accepted

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

int_a = []
for i in range(N):
    int_a.append(int(a[i]))

cnt = 0
for i in range(N):
    if (int_a[i] % 2) == 0:
        t = int_a[i]
        while t > 1:
            if (t % 2) == 0:
                cnt += 1
            t /= 2

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
a=[None]*N
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 = [int(i) for i in input().split()]

count = 0
for ai in a:
    if ai % 2 == 0:
        while ai % 2 != 1:
            ai = ai // 2
            count += 1

print(count)

Submission status: Accepted

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

answer = 0
for a_i in a:
    while a_i % 2 == 0:
        answer += 1
        a_i = a_i / 2

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N=int(input().strip())
A=list(map(int,input().split()))
nns=[2**i for i in range(31)]
def func(n,x):
    return n%nns[x]==0
def binsearch_int(func, min_x, max_x):
    """func(x) == Trueとなる最大のxを返す
    """
    if func(max_x):
        return max_x
    if not func(min_x):
        return None
    left,right=min_x,max_x
    while left+1<right:
        mid=(left+right)//2
        if func(mid):
            left=mid
        else:
            right=mid
    return left
print(sum(binsearch_int(lambda x: func(i,x),0,int(math.log2(i))+1) for i in A))

Submission status: Accepted

Solution code:
N = int(input())
a = input().split(" ")
cou = 0

for i in range(N):
    tmp = int(a[i])
    while(True):
        if(tmp%2==0):
            cou=cou+1
            tmp = tmp/2
        else:
            break

print(cou)

Submission status: Accepted

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

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

Submission status: Accepted

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

z = 0
for i in range(0, N):
	a = int(A[i])
	while True:
		m = a % 2
		if m > 0:
			break
		else:
			z += 1
		a /= 2

print(z)

Submission status: Accepted

Solution code:
N = int(input())
lst = list(map(int, input().split()))
cnt = 0

for i in lst:
    n = i
    
    while n % 2 == 0:
        n /= 2
        cnt += 1

print(cnt)

Submission status: Accepted

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

count = 0

for i in A:
    while(True):
        if i%2 == 1:
            break

        i = i/2
        count += 1

print(count)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    _ = input()
    nums = map(int, input().split(" "))
    count = 0
    for n in nums:
        while n%2 == 0:
            n /= 2
            count += 1
 
    print(count)

Submission status: Accepted

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


def num_two_div(a):
    n = a
    for i in range(a):
        if n % 2 == 0:
            n //= 2
        else:
            return i
    raise Exception

count = 0
for a in A:
    # print(num_two_div(a))
    count += num_two_div(a)

print(count)

Submission status: Accepted

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

ans = 0
for i in a:
    j = int(i)
    while j % 2 == 0:
        j = j//2
        ans = ans + 1

print(ans)

Submission status: Accepted

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


def devide(k, l=0):
    if k % 2 == 1:
        return l
    return devide(k/2, l+1)

sum = 0

for i in range(n):
    sum += devide(a[i])

print(sum)