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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
j=0
s=0
N=int(input())
#Nori=N
#D, N=input().split()
#S=input()
#T=input()
#S_list=list(S)
factor_list=  list(map(int, input().split(" ")))
def deletef(j):#関数は必ずreturnすること
    if j%2 ==0:
      return  j/2
    else:
        j=0
        return j

for i in range (10**13):
 factor_list = list(map(deletef ,factor_list))
 b = [x for x in factor_list if x >= 1]
 factor_list=b
 s=s+len(b)
 if len(b)==0:
     break
print(s)

#M=int(input())
#drink_list = [list(map(int, input().split(" ")))for i in range(M)]
#print(T_list[1])
#D=int(D)
#N=int(N)
#不本意だが内包表記で二次元の空のリストを作成する
     
#dp=[['' for i in range(2)] for j in range(N)]
#absTH=[''for i in range(N)]
#K=int(K)
#S_list=[]
#sentence_list=[]
#total=0
#mojiretu=""
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#for i in range(K):
# ID_list.append(i+1)
#print(ID_list)
#for i in range(H)
#この下の行が二次元リストの読み込
#intを消して記号を読み込めるようにしたしかしこれでは文字列から読み込んでいるのと同じ
#weight_value_list =  [list(input())for i in range(N)]#一文字づつばらして入れてしまう
#s = [input() for i in range(N)]
#複数行に複数の入力値を取得し、出力する
#sentence_list =  (list(input())for i in range(N))
#for i in range(H):
#  ppixel_list=list(input())
    
#print(pixel_list)
#high_pixel_list =[['' for i in range(W)]for j in range(2*H)]
#print(high_pixel_list)
#print(pixel_list[0][1])#行　列の順番にかっこが並んでいる
#print(a_list)
first_term=0
second_term=0
#整数二次元配列を読み込む時のやり方
#a_b_c_list =  [list(map(int, input().split(" ")))for i in range(N)]
     
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
  
     
#x, y = [0]*N, [0]*N#N個の空のリストを作成
#l = list(range(N))#範囲がNのリストを作成する
     
#for i in range(N):
#  x[i], y[i] = map(int, input().split())
#分けて入力する形式を設定することで可読性が高く仕上がっている
#素晴らしいことだ
     
     
distance = 0
#comb = list(itertools.permutations(l))
#prmutation:英語の意味としては順列である
'''p[, r]で
長さrのタプル列、重複なしのあらゆる並びを表す
今回はリストlの重複なしの並び替え順序を新たなリストに収納している
並び方を計算しリストに収納しているイメージ
l[0,1,2]
l[0,2,1]これにもリスト番号が0,1,2と割り振られている
これが全通り入っている
これ作った人はすごい
自分も早く理解したい
'''
#for i in range(0, len(comb)):#i番目のパターンの時を考える。
#  for j in range(0, N-1):#lのリスト番号を読み込み
#    distance += math.sqrt((x[comb[i][j]]-x[comb[i][j+1]])**2 + (y[comb[i][j]]-y[comb[i][j+1]])**2)
'''
各経路の距離を足していき全距離分を経路数
で割れば平均距離が出るので各経路ごとの距離は
不必要と判断されている。
'''
#print(distance/len(comb))
# dp[i+1][j]=max(dp[i][j]+a_b_c_list[i],dp[i][j],dp[i][j])
#リストを一周するようにすればいいのか

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

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

print(cnt2)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in a:
  while i%2==0:
    i/=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(len(a)):
    count = 0
    while(True):
        if a[i] % 2 == 0:
            count += 1
            a[i] /= 2
        else:
            break
    ans += count


print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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



cnt = 0

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

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=list(map(int, input().split()))
A=list(map(int, input().split()))
ret=0

def div2(num):
    if(num%2==0):
        global ret
        ret+=1
        div2(num/2)
    else:
        return

for a in A:
    div2(a)

print(ret)

Submission status: Accepted

Solution code:
def bunkai(num):
    count = 0
    while num % 2 == 0:
        count += 1
        num /= 2
    return count
_ = input()
gyouretu = list(map(int, input().split()))
dst = 0
for g in gyouretu:
    dst += bunkai(g)
print(dst)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

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:
N=int(input())
a=list(map(int,input().split()))
flag=False
cnt=0

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

Submission status: Accepted

Solution code:
import sys
import numpy
N = int(input())
L = [i for i in map(int,input().split()) if i%2 == 0]
L2 = [0 for i in range(len(L))]
if L == []:
  print(0)
  sys.exit(0)
for i in range(len(L)):
    s = 1
    while L[i] % 2**s == 0:
        s += 1
    L2[i] = s-1
Q = numpy.sum(L2)
print(Q)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
a = input().split()
import numpy as np
a = np.array(a).astype(int).tolist()
count = 0
for aa in a:
    #n = np.log2(a)
    while(True):
        if aa % 2 == 0:
            aa = aa / 2
            count = count + 1
        else :
            break;
    
print(int(count))

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]=A[i]//2
        ans+=1
print(ans)

Submission status: Accepted

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

al = []
for at in a:
    bin_str = bin(at)
    if bin_str.rfind('0')+1 == len(bin_str):
        al.append(bin_str.rfind('0')-bin_str.rfind('1'))
    else:
        al.append(0)

print(sum(al))

Submission status: Accepted

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

def waru(x):
    cnt=0
    while x%2==0:
        x=int(x/2)
        cnt+=1
    return cnt
ans=0
for num in a:
    if num%2==0:
        ans+=waru(num)
print(ans)

Submission status: Accepted

Solution code:
import bisect
# from collections import Counter, defaultdict, deque, namedtuple
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n = int(input())
    a = list(map(int,ipti().split()))

    count = 0

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

    print(count)

if __name__ == '__main__':
    main()

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:
N = int(input())
A = list(map(int, input().split()))

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

Submission status: Accepted

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

def two(n):
  i = n
  c = 0
  while i%2==0:
    i//=2
    c+=1
  return c

c = sum(list(map(two,A)))
print(c)

Submission status: Accepted

Solution code:
n=int(input())
cnt=0
L=list(map(int,input().split()))
for i in range(n):
    n=L[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()))
cnt = 0
for i in range(n):
    while a[i]%2 == 0:
        a[i] /= 2
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
# import math
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque
# from collections import Counter

import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())
# 配列入力の受け取り
arrA = np.array(input().split(),dtype=np.int64)

ans = 0
while len(arrA)>0:
    filter = (arrA%2 == 0)
    ans += len(arrA[filter])
    arrA = arrA[filter]//2

print(ans)

Submission status: Accepted

Solution code:
def func(x):
    cnt = 0
    while True:
        if x % 2 == 0:
            cnt += 1
            x = x // 2
        else:
            return cnt


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

cnt = 0
for i in range(N):
    cnt += func(a[i])

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

def func(x):
  cnt=0
  while 1:
    if x%2==0:
      x=x//2
      cnt+=1
    else:
      return cnt

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x=int(input())
y=list(map(int, input().split()))

ansb=0
t=0
for i in range(x):
	t=y[i]
	while t%2==0:
		ansb=ansb+1
		t=t/2
print(ansb)

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,*nums = map(int, open(0).read().split())
print(sum([format(num, 'b')[::-1].find('1') for num in nums]))

Submission status: Accepted

Solution code:
n,*nums = map(int, open(0).read().split())
cnt = 0
for num in nums:
    cnt += format(num, 'b')[::-1].find('1')
print(cnt)

Submission status: Accepted

Solution code:
n,*nums = map(int, open(0).read().split())
cnt = 0
for num in nums:
    bin_num = format(num, 'b')
    cnt += bin_num[::-1].find('1')
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# C - *3 or /2
import sys 
import math
#def input(): return sys.stdin.readline().rstrip()
def exp_bin(n):
    e = 0
    while(n%2==0):
        e += 1
        n = int(n/2)
    return e

N = int(input())
A = map(int, input().split())
ans = 0
for a in A:
    ans += exp_bin(a)
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    ans = 0
    for i in range(n):
        ans += format(a[i], 'b')[::-1].find('1')

    print(ans)

Submission status: Accepted

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

e = 0
for a in A:
    l = 0
    over = a.bit_length()
    while over - l > 1:
        m = (l+over) // 2
        if a & ((1<<m)-1) == 0: l = m
        else: over = m
    e += l
print(e)

Submission status: Accepted

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

e = 0
for a in A:
    l = 0
    over = a.bit_length()
    while over - l > 1:
        m = (l+over) // 2
        if a % (1<<m) == 0: l = m
        else: over = m
    e += l
print(e)

Submission status: Accepted

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

e = 0
for a in A:
    while a&1 == 0:
        e += 1
        a >>= 1
print(e)

Submission status: Accepted

Solution code:
def count(x):
    cnt=0
    while x!=0:
        if x%2==0:
            x//=2
            cnt+=1
        else:
            break
    return cnt
n=int(input())
a=list(map(int,input().split()))
ans=0
for aa in a:
    if aa%2==0:
        ans+=count(aa)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
import math
for i in range(N):
  if a[i] % 2 != 0:
    continue
  while a[i] % 2 == 0:
    a[i] = a[i] /2
    ans += 1
print(ans)

Submission status: Accepted

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

            if a[i]%2==0:
                b+=1

    if b==0:
        print(count)
        exit()

Submission status: Accepted

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

print(tmp)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in a:
    while i % 2 == 0:
        cnt += 1
        i = i//2
print(cnt)
"""cnt = 0
for i in a:
    while i % 2 == 0:
        i = i // 2
        cnt += 1
print(cnt)"""

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:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

ans = 0
for i in a:
    if i % 2 == 0:
        tmp = 0
        while True:
            if i % 2 == 1:
                break
            else:
                i /= 2
                tmp += 1
        ans += tmp
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
cnt = []
for i in range(n):
    j = 0
    while a[i] == int(a[i]):
        a[i] /= 2
        j += 1
    cnt.append(j - 1)
print(sum(cnt))

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(n):
    a = A[i]
    ans += format(a, 'b')[::-1].find('1')
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
count=0
for i in range(len(L)):
	while(1):
		if L[i]%2!=0:
			break
		else:
			L[i]=L[i]//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:
    while a % 2 == 0:
        if not a:
            break
        ans += 1
        a //= 2

print(ans)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline

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

ans = 0

# 各要素について素因数分解を行い、2の乗数が答えになる
for i in a:
    num = 1
    while (i % 2 ** num) == 0:
       ans += 1
       num += 1

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
a = [int(x) for x in input().split()]

def beki(i) :
    t = 0
    while i%2 == 0 :
        t += 1
        i //= 2
    return t

ans = 0
for i in a :
    ans += beki(i)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum(z))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe


# my functions here!
#標準エラー出力
def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(*args):
    print(*args,file=sys.stderr)

def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
     
#input

                
def resolve():
    N,=pin()
    b=list(pin())
    
    ans=0
    for i in range(N):
        temp=0
        t=b[i]
        while(t%2==0):
            t//=2
            temp+=1
        #print(temp)
        ans+=temp
    print(ans)
        #print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
#if __name__=="__main__":resolve()

"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """3
5 2 4"""
        output = """3"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """4
631 577 243 199"""
        output = """0"""
        self.assertIO(input, output)
    
if __name__=="__main__":resolve()

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
t = 0

for i in A:
    while(i % 2 == 0):
        t += 1
        i = i // 2
print(t)

Submission status: Accepted

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

N = int(input().strip())
a_list = list(map(int, input().rstrip().split()))
#-----

a_even_list=[]
for v in a_list:
    if v%2 == 0 and v != 0:
        a_even_list.append(v)

cnt=0
for v in a_list:
    while v%2 == 0 and v != 0:
        v /= 2
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
def main():
    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)


if __name__ =='__main__':
    main()

Submission status: Accepted

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

cnt = 0
for a in A:
    v = a
    while v % 2 == 0:
        v //= 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:
  B = i
  while B % 2 == 0:
    result += 1
    B = B // 2
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ARR = [int(s) for s in input().split(" ")]

def calculate(arr):
    evens = []
    for ar in arr:
        if ar % 2 == 0:
            evens.append(ar)

    counts = 0
    for ev in evens:
        while ev % 2 == 0:
            counts = counts + 1
            ev = ev / 2
    print(counts)

calculate(ARR)

Submission status: Accepted

Solution code:
n=int(input())

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

ans = 0
for i in t:
    while i%2==0:
        i = i//2
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#100_C
def cnt_2(x):
    cnt=0
    while x%2==0:
        cnt+=1
        x//=2
    return cnt
n=int(input())
print(sum([cnt_2(int(x)) for x in input().split()]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

ans = list(f(i) for i in A)

print(sum(ans))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
c = 0
a = [j for j in a if j % 2 == 0]
a.sort(reverse = True)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
a = list(map(int,input().split()))
a = np.array(a)
ans = 0

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

print(ans)

Submission status: Accepted

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

# 奇数に3倍しても偶数になる(2で割れる)ことはないので、
# aの各項が何回2で割れるかを数え上げればよい
cnt = 0
for a in A:
    while a%2 == 0 and a > 0:
        a//=2
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
a = np.array(list(map(int, input().split())))
ans = 0
while len(a) != 0:
    a = a[a % 2 == 0]
    ans += len(a)
    a = a // 2
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
N = int(input())
a = list(map(int, input().split()))


def cnt_2(num):
    cnt = 0
    while num % 2 == 0:
        num //= 2
        cnt += 1
    return cnt

_cnt=0
for i in range(N):
    _cnt+=cnt_2(a[i])
print(_cnt)

Submission status: Accepted

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

Submission status: Accepted

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

def cnt2(n):
    ret = 0
    while n % 2 == 0:
        n //= 2
        ret += 1
    return ret

answer = 0
for a in A:
    answer += cnt2(a)
    
print(answer)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr=limii()

ans=0

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

Submission status: Accepted

Solution code:
#2 or 3
n=int(input())
lists=list(map(int,input().split()))
count=0
for some in lists:
    while some%2==0:
        count+=1
        some=some//2
print(count)

Submission status: Accepted

Solution code:
import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


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


N, *a = map(int, read().split())
ans = 0
for i in a:
    ans += count(i)
print(ans)

Submission status: Accepted

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


def trial_division(n):
    #２で割った因数を格納するリスト
    factor = []
    #2で割れなくなった時点でストップ
    while n % 2 == 0:
        n //= 2    # ２で割った商を切り捨てて代入
        factor.append(2)
    #nが一度も２で割れなかったらそのまま返す
    if not factor:
        return [n]
    else:
        factor.append(n)
        return factor


count = 0
for i in a:
    temp = trial_division(i)
    count += temp.count(2)

print(count)

Submission status: Accepted

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


def trial_division(n):
    factor = []
    tmp = int(math.sqrt(n)) + 1
    for _ in range(2,tmp):
        while n % 2 == 0:
            n //= 2
            factor.append(2)
    if not factor:
        return [n]
    else:
        factor.append(n)
        return factor


count = 0
for i in a:
    temp = trial_division(i)
    count += temp.count(2)

print(count)