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()))
count = 0

for i in range(N):
    if a[i]%2==0:
        tmp = a[i]
        while True:
            if tmp%2==1:
                break
            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:
    i = 0
    res = 0
    while True:
        if a % pow(2, i) == 0:
            res = i
        if a < pow(2, i):
            ans += res
            break
        i += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = 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:
def tc(x):
    c=0
    while x&1==0:
        c+=1
        x=x>>1
    return c
n=int(input())
a=[int(i) for i in input().split()]
c=0
for i in range(n):
    c+=tc(a[i])
print(c)

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def cnt(a):
    if a&1:
        return 0
    else:
        return 1 + cnt(a//2)

def solve():
    n = f()[0]
    a = f()

    ans = 0
    for i in a:
        ans += cnt(i)
    
    print(ans)



solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n = readi()
p = readl()
count = 0
for i in p:
    while(i % 2 == 0):
        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 range(n):
    for j in range(30):
        if a[i]%2 == 0:
            a[i] /= 2
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
s=list(map(int,input().split(" ")))
ans=0
for z in s:
  while True:
    if z&0x1==0:
      ans+=1
      z=z>>1
    else:
      break
print(ans)

Submission status: Accepted

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

count = 0
for item in lis:
  tmp = item
  while True:
    if tmp % 2 == 0:
      count += 1
      tmp //= 2
    else:
      break
print(count)

Submission status: Accepted

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

def divisors2_count(n):
  num = 0
  while n % 2 == 0:
    num += 1
    n = int(n/2)
  return num

ans = 0
for x in A:
  ans += divisors2_count(x)

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

Submission status: Accepted

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

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

print (ans)

Submission status: Accepted

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

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

def solve(N: int, A: "List[int]"):
    ret = 0
    for a in A:
        ret += calc(a)
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    n = intin()
    alist = intina()

    ans = 0

    for a in alist:
        while a & 1 == 0:
            a >>= 1
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

total = 0

for ai in a:
    while ai % 2 == 0:
        ai /= 2
        total += 1

print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = [int(_) for _ in input().split()]
count = 0
while a != []:
    for i in range(len(a)):
        if a[i]%2 == 1:
            a[i] = 0
        else:
            a[i] = int(a[i]/2)
    while 0 in a:
        a.remove(0)
    count += len(a)
print(count)

Submission status: Accepted

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

cnt = 0
flg = True
while flg:
  flg = False
  minus = 0
  for i in range(0, len(a)):
    if not a[i+minus]%2:
      a[i+minus] = a[i+minus] / 2
      flg = True
      cnt += 1
      break
    else:
      a.pop(i+minus)
      minus -= 1

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# IMPORT ###############################################################################################################
import sys                                                      # システム
sys.setrecursionlimit(10**6)                                    # 再帰処理の上限変更
from collections import deque, Counter                          # キュー・個数カウント
from itertools   import accumulate, permutations, combinations  # 累積和・順列・組み合わせ
from operator    import itemgetter                              # ソート補助
from bisect      import bisect_left, bisect_right, bisect       # 二分探索
from heapq       import heappop, heappush                       # プライオリティキュー
from fractions   import gcd                                     # 最大公約数
from math        import ceil, floor, sqrt, cos, sin, tan, pi    # 数学処理
from copy        import deepcopy                                # オブジェクトコピー
import numpy         as np                                      # 数値計算

# MAIN #################################################################################################################
def main():
    # Init #############################################################################################################
    im = InputManager()
    # Input ############################################################################################################
    n = im.inputSingle()
    a = im.inputMultiple(aslist=True)
    # Logic ############################################################################################################
    count = 0
    for ai in a:
        while ai % 2 == 0:
            count += 1
            ai = ai // 2
    # Output ###########################################################################################################
    print(count)
    # Return ###########################################################################################################
    return

# INPUT MANAGER ########################################################################################################
class InputManager(object):
    def __init__(self):
        pass

    @staticmethod
    def inputSingle(dtype=int):
        return dtype(input())
    
    @staticmethod
    def inputMultiple(dtype=int, aslist=False):
        if aslist:
            return list(map(dtype, input().split()))
        else:
            return map(dtype, input().split())

    @staticmethod
    def input2D(h, dtype=int):
        return [list(map(dtype, input().split())) for i in range(h)]

# CALL MAIN ############################################################################################################
main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().rstrip().split()))
even = [i for i in a if i%2 == 0]
count = 0
for i in even:
    c = 0
    while True:
        rem = i % 2
        i //= 2
        if rem == 1:
            break
        c += 1
    count += c
print(count)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().rstrip().split()))
even = [i for i in a if i%2 == 0]
count = 0
for i in even:
    c = 0
    for j in range(100):
        rem = i % 2
        i //= 2
        if rem == 1:
            break
        c += 1
    count += c
print(count)

Submission status: Accepted

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

count=0
for a in a_list:
  tmpa=a
  while tmpa%2==0:
    count+=1
    tmpa//=2
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:
        a //= 2
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_ = 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())
l = list(map(int, input().split()))

ans = 0
flag = 1
i = 1
while flag:
  y = 2**i
  m = list(map(lambda x: x%y, l))
  if 0 in m:
    ans += m.count(0)
    i += 1
  else:
    flag = 0
print(ans)

Submission status: Accepted

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

def d(p):
    if p%2==0:
        return d(p/2)+1
    else:
        return 0

answer=0
for i in a:
    answer+=d(i)
print(answer)

Submission status: Accepted

Solution code:
def C():
    n = int(input())
    a = list(map(int,input().split()))
    even_count = 0
    for i in a :
        while not i&1:
            i //= 2
            even_count += 1
    
    print(even_count)

C()

Submission status: Accepted

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

cnt = 0

for i in range(n):
    for j in range(0,30):
        if a[i]%2**(j+1) != 0:
            cnt += j
            break

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
input()
xs = map(int, input().split())
cnt = lambda n: bin(n)[::-1].find('1')
print(sum(cnt(x) for x in xs))

Submission status: Accepted

Solution code:
def cnt(n):
  c = 0
  while True:
    n, flag = n >> 1, n & 1
    if flag: break
    c = c + 1
  return c

input()
xs = map(int, input().split())
print(sum(cnt(x) for x in xs))

Submission status: Accepted

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

def f(a,ret):
    if a%2 == 1:
        return ret
    return f(a//2,ret+1)

ans = 0
for a in A:
    ans += f(a,0)
print(ans)

Submission status: Accepted

Solution code:


def main():
    num = int(input())
    data = list(map(int, input().split()))

    count = 0
    for i in range(num):
        now_num = data[i]
        while now_num % 2 == 0:
            now_num //= 2
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
input()
aa=map(int,input().split())
n = 0
for a in aa:
    while a & 1 == 0:
        a >>= 1
        n += 1 
print(n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def count(num,cnt):
  if num%2==1:
    return cnt
  else:
    return count(num//2,cnt+1)

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

Submission status: Accepted

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

N = int(input())
L = [int(v) for v in input().split()]

c = 0
for v in L:
    if v % 2 == 0:
        while v % 2 == 0:
            v = v // 2
            c += 1
            
print(c)

Submission status: Accepted

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

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

a = 0
cnt = 0


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
cnt = 0

for k in A:
    while k % 2 == 0:
        k /= 2
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

max_idx = int(math.log2(1000000000))
exp2 = [1] * max_idx + [1]
for i in range(1, max_idx + 1):
  exp2[i] = 2 ** i

ans = 0
for i in range(len(A)):
  for j in range(max_idx, 0, -1):
    if A[i] % exp2[j] == 0:
      ans += j
      break
print(ans)

Submission status: Accepted

Solution code:
N, *a = map(int, open(0).read().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, *a = map(int, open(0).read().split())
ans = 0
for i in range(N):
    ans += len(bin(a[i])) - bin(a[i]).rfind('1') - 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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


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


print(sum(div_two(i) for i in a))

Submission status: Accepted

Solution code:
def function(num) :
    cnt = 0
    while num % 2 == 0 :
        num /= 2
        cnt += 1
    return cnt

N = int(input())
li = list(map(int,input().split()))
ans = 0
for i in li :
    ans += function(i)

print(ans)

Submission status: Accepted

Solution code:
def read_input():
	n = int(input())
	alist = list(map(int, input().split()))
	
	return n, alist

	
def count_dividable_by_2(x):
	count = 0
	
	while x % 2 == 0:
		count += 1
		x /= 2
		
	return count
	
	
def submit():
	n, alist = read_input()

	blist = [count_dividable_by_2(x) for x in alist]
	print(sum(blist))	
	
submit()

Submission status: Accepted

Solution code:

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


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

res = [count_divisor(i) for i in A]
print(sum(res))

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:
def devide_two(a, counter):

    if a == []:
        return counter

    temp_a = []
    for i in a:
        if i % 2 == 0:
            counter += 1
            temp_a += [i//2]

    return devide_two(temp_a, counter)

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

print(devide_two(a, counter = 0))

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//=2
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

num = 0
A =[int(i) for i in input().split()]

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

print(num)

Submission status: Accepted

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

for i in range(n):
    dig = lista[i]
    for j in range(30,0,-1):
        if dig%(2**j)==0:
            count+=j
            break
            
print(count)

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):
        b=b/2
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
ans = 0

N = int(input())

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
src = list(map(int,input().split()))
ans = 0

for i in src:
    while i%2 == 0:
        i /= 2
        ans += 1
        
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:
            i /= 2
            cnt += 1
        else:
            break

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np

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

i = 0
count = 0

while i < n:
  x = x_list[i]
  while x % 2 == 0:
    count += 1
    x = x / 2
  i += 1
  
print(count)

Submission status: Accepted

Solution code:
N=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:
        cnt += 1
        a /= 2
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0

for i in range(n):
    for j in range(1, 33):
        if a[i]%2 ==0 and a[i]>=2:
            a[i] /=2
            ans += 1

print(ans)

Submission status: Accepted

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

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

B = [count(i) for i in A]
print(sum(B))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

  ans += j


print(ans)

Submission status: Accepted

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

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

    ans = 0
    #  素因数分解したときの2**x の xの総和が答え
    for a in A:
        while a%2 == 0:
            a = a / 2
            ans += 1
    
    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

    ans = 0
    # 2**x の xの総和が答え
    for a in A:
        while a%2 == 0:
            a = a / 2
            ans += 1
    
    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())

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

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

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
a=[bin(int(i))[::-1].index('1') for i in input().split()]
print(sum(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

print(count)

Submission status: Accepted

Solution code:
input()

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

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

Submission status: Accepted

Solution code:


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

def check_2_pow(num):
    result = 0
    while num % 2 == 0:
        num /= 2
        result += 1
    return result

print(sum(map(check_2_pow, a_list)))

Submission status: Accepted

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

count = 0
for a in a_s:
    a_tmp = a
    while True:
        if a_tmp == 0:
            break
        elif a_tmp % 2 == 0:
            count += 1
            a_tmp /= 2
        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:
        A[i] = A[i] // 2
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys
import numpy as np

readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]

n = readInt()
a = readIntN()

ret = 0
for v in a:
    while (v % 2) == 0:
        ret += 1
        v /= 2
print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
a=list(map(int,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,*a=map(int,open(0).read().split())
def f(x):
    ans=0
    while x%2==0 :
        ans+=1
        x//=2
    return ans
print(sum(map(f,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] /= 2
        count += 1
    
print(count)

Submission status: Accepted

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

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

	print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def nn(i):
  count=0
  while i%2==0:
    count+=1
    i=i//2
  return count

n=int(input())
A=[nn(int(i)) for i in input().split()]
print(sum(A))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def count_div(number, divisor):
    counter = 0
    while number % divisor == 0:
        counter += 1
        number = number // divisor
    return counter


if __name__ == '__main__':
    n = int(input())
    number_list = list(map(int, input().split()))

    count = 0
    for number in number_list:
        count += count_div(number, 2)

    print(count)