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


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

Submission status: Accepted

Solution code:
N=int(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:
#!/usr/bin/env python3
import sys

def countDiv2(n:int):
    sum = 0
    while n % 2 == 0:
        sum += 1
        n //=2
    return sum

def solve(N: int, a: "List[int]"):
    sum = 0
    for ia in a:
        sum += countDiv2(ia)
    print(sum)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
N = int(input())
a = [int(x) for x in input().split()]
ans = 0

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

Submission status: Accepted

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

def ctd(n):
    count = 0
    while n % 2 == 0:
        count += 1
        n /= 2
    return count

ctd_l = list(map(ctd, a))
print(sum(ctd_l))

Submission status: Accepted

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

count = 0
for i in a:
    j = 2
    while i != 0:
        if i % j == 0:
            count += 1
            i //= 2
        else:
            break

print(count)

Submission status: Accepted

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

a_g = [i for i in a_ if i%2 == 0]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

counter = 0
for i in range(n):
    b = a[i]
    while True:
        if b % 2 == 1:
            break
        b = int(b / 2)
        counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")

import math
import collections


def solve(N: int, a: "List[int]"):
    print(int(sum([math.log2(v & -v) for v in a])))
    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:
len_list = int(input())
input_list = [int(x) for x in input().split()][:len_list]

n = 0

for x in input_list :
   while (x % 2) == 0 :
      x/=2
      n+=1      
print(n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

counter = 0
for i in range(0,N):
    while As[i] % 2 == 0:
        As[i] /= 2
        counter += 1

print(counter)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
_,a=open(0);print(sum(bin(int(x))[::-1].index('1')for x in a.split()))

Submission status: Accepted

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

def counter(x):
    num = 0
    while x%2==0:
        num += 1
        x /= 2
    return num

s = [counter(i) for i in a]
print(sum(s))

Submission status: Accepted

Solution code:

import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
N = int(stdin.readline())
nums = tuple(li())
total = 0
for n in nums:
    while n % 2 == 0:
        total += 1
        n = n / 2
print(total)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
a = LIST()
count = 0
flag = 0
"""
while flag == 0:
	print(a)
	for i in range(N):
		if a[i] % 2 == 0:
			a[i] = int(a[i]/2)
			count += 1
			break
	else:
		flag = 1
"""
for i in a:
    while i % 2 == 0:
        count += 1
        i /= 2
print(count)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


n = int(input())

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


a_even = [x for x in a if x % 2 == 0]

lis = [func(x) for x in a]

# print(lis)

print(sum(lis))

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = 1
ans = 0
for i in range(N):
    for j in range(32, 0, -1):
        if A[i] % (2**j) == 0:
            ans += j
            A[i] = A[i] / (2**j)
print(ans)

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(str(cnt))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
from functools import reduce
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # greatest common divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # least common multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


n = II()
a = LI()
counter = 0
for i in a:
    while(i % 2 == 0):
        i //= 2
        counter += 1
P(counter)

Submission status: Accepted

Solution code:
def count(n_str):
    n = int(n_str)
    c = 0
    while n % 2 == 0:
        c += 1
        n = n / 2
    return c


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

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/=2

print(ans)

Submission status: Accepted

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

import re

n = int(input())

a = input()
a = re.split(" ",a)

count = 0
for i in range(len(a)):
    if(int(a[i]) % 2 == 0):
        while(int(a[i]) > 1):
            a[i] = int(a[i])/2
            count += 1
            if(int(a[i]) % 2 != 0):
                break;
    else:
        pass

print(count)

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

print(cnt)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    s = S()
    c = s.count("0")
    print(2*min(c,len(s)-c))
    return

#B
def B():
    n = I()
    h = LI()
    ans = 0
    m = min(h)
    while m:
        ans += m
        k = max(h)
        for i in range(n):
            if h[i] >= m:
                h[i] -= m
                if h[i]:k = min(k,h[i])
            else:break
        m = k
    print(ans)
    return

#C
def C():
    n,k = LI()
    x = LI()
    ans = float("inf")
    j = bisect.bisect_left(x,0)
    if n == 1:
        print(abs(x[0]))
        quit()
    if j < n:
        if x[j] == 0:
            k -= 1
            x.pop(j)
            n -= 1
    for i in range(n):
        if i < j:
            if abs(i-j) > k:continue
            elif abs(i-j) == k:ans = min(ans,abs(x[i]))
            elif k+i-1 < n:
                ans = min(ans,abs(x[i])+x[k+i-1]-x[i])
        else:
            if abs(i-j)+1 > k:continue
            elif abs(i-j)+1 == k:ans = min(ans,x[i])
            elif i-k+1 >= 0:
                ans = min(ans,abs(x[i])+x[i]-x[i-k+1])

    print(ans)
    return

#D
def D():
    n = I()
    a = LI()
    ans = 0
    p = [1<<i for i in range(100)]
    for i in range(n):
        l = 0
        r = 100
        while r-l > 1:
            m = (l+r)//2
            if a[i]%p[m] == 0:
                l = m
            else:
                r = m
        ans += l
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#I
def I_():
    return

#J
def J():
    return

#Solve
if __name__ == "__main__":
    D()

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
def count(i):
  c = 0
  while i%2 != 1:
    i /= 2
    c += 1
  return c

print(sum([count(i) for i in a]))

Submission status: Accepted

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

def solve(N):
    fac = 0
    for i in a:
        while True:
            if i % 2 == 0:
                fac = fac + 1
                i = i//2
            else:
                break
    return fac

print(solve(N))

Submission status: Accepted

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

N = int(input())
A = list(map(int, input().rstrip().split(' ')))
    
num_2 = 0
for a in A:
    while True:
        if a % 2 == 0:
            a /= 2
            num_2 += 1
        else:
            break
        
print(num_2)

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 = int(a/2)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in b:
  for j in range(30):
    if i%2==0:
      c+=1
      i//=2
    else:
      break
print(c)

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

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

ans = 0
for i in a:
    count = 0
    j = i
    while j >= 0:
        if j % 2 == 0:
            j = int(j/2)
            count += 1
        else:
            break
    ans += count

print(ans)

Submission status: Accepted

Solution code:
# 100 C

N =int(input())
a =[int(j) for j in input().split()]
ans = 0
for i in range(N):
    tmp=0
    for j in range(1,30):
        if a[i]%(2 ** j)==0:
            tmp = max(tmp,j)
    ans +=tmp
print(ans)

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


# globals
N = 0
A = []


def set_inputs():
    global N, A
    N = get_int()
    A = get_li()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    ans = 0
    for a in A:
        while a % 2 == 0:
            a //= 2
            ans += 1
    print(ans)
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


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


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return zip(*(
        [t(x) for t, x in zip(types, input().split())]
        for _ in range(n)
    ))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
flag=True
n=int(input())
A=list(map(int,input().split()))
cnt=0
while flag:
  ls=[]
  tmp=False
  for a in A:
    if a%2==0:
      tmp=True
      cnt+=1
      ls.append(a//2)
  A=ls
  if tmp==False:
    flag=False
print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(x) for x in 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:
_ = int(input())
A = [ int(x) for x in input().split() ]

ans = 0

for a in A:
    while a & 1 == 0:
        a //= 2
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

list_even = [n for n in A if n % 2 == 0]

cnt_all = 0
for even in list_even:
  cnt_by_even = 0
  while even % 2 == 0:
    even = even / 2
    cnt_by_even += 1
  
  cnt_all += cnt_by_even
  
print(cnt_all)

'''考え方
偶数の値だけを取得し、何回２で割り算することができるか、を計算する。
'''

Submission status: Accepted

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

Submission status: Accepted

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

twos = 0
for item in a:
  while item % 2 == 0 and item is not 0:
    item //= 2
    twos += 1
    
print(twos)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#数列のすべての項の積を2で何回割れるか調べて出力する
N=int(input())
ListA=[]
A=input()
ListA=A.split()
ListB=[]
for i in range(0,len(ListA),1):
  ListB.append(int(ListA[i]))
c=0
S=0
for i in range(0,len(ListB),1):
  A=int(ListB[i])
  while A%2==0:
    A=A/2
    c+=1
  else:
    S+=c
    c=0
print(S)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(x) for x in input().split()]
p = [0]*N

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

print(sum(p))

Submission status: Accepted

Solution code:
#sys.stdin.readline()
import sys
input = sys.stdin.readline

def counter(n):
  count1 = 0
  while(1):
    if(n%2 == 1):
      break
    else:
      n = n//2
      count1 += 1
  return count1

N = int(input())
A = list(map(int,input().split()))
count = 0
for a in A:
  count += counter(a)

print(count)

Submission status: Accepted

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

def mod2(a):
  ret = 0
  while a%2==0:
    ret +=1
    a=a//2
  return ret

print(sum([mod2(a) for a in A]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def div_2(cnt, num):
  if num % 2 != 0:
    return cnt
  else:
    cnt += 1
    return div_2(cnt, int(num / 2))

cnt = 0
n = int(input())
a_lst = input().split()
for elem in a_lst:
  cnt = div_2(cnt, int(elem))

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

def count_two(n):
    r = 0
    while n % 2 == 0:
        n = n // 2
        r += 1
    return r

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

Submission status: Accepted

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


N = int(input())
alist = list(map(int, input().split()))
ans = 0
for num in alist:
    ans += factor2(num)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
def count_two(num):
    flag=0
    count=0
    while flag==0:
        if num%2==0:
            count+=1
            num=int(num/2)
        else:
            flag=1
    return count

ans=0
for temp in A:
    ans+=count_two(temp)
print(ans)

Submission status: Accepted

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

for i in a:
    cnt = 0
    for j in range(1, 31):
        if i % 2**j == 0 and i // 2**j != 0:
            cnt += 1
        else:
            Res += cnt
            break

print(Res)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())

rem = pow(10,9)+7

n = ip()                                     #入力整数1つ
#x,y= (int(i) for i in input().split())       #入力整数横2つ以上
a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[input() for i in range(x)]    #入力セット(整数改行あり)(2/2)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
s = 0
for i in range(n):
    while a[i]%2==0:
        a[i]//=2
        s+=1
print(s)

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

N = I()
A = LI()

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

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

count = [calc(a) for a in Ai]
m = sum(count)
print(m)

Submission status: Accepted

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

Submission status: Accepted

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


N = int(input())
A = [int(i) for i in input().split()]
ans = [solve(a) for a in A]
print(sum(ans))

Submission status: Accepted

Solution code:
n = int(input())

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

res = 0
for num in l:
    while num!=0:
        if (num & 1)==0:
            res += 1
            num >>= 1
        else:
            break
print(res)

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

Solution code:
N=input()
lst=map(int,input().split())
ans=0
for i in lst:
	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()]

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

Submission status: Accepted

Solution code:
def solve(string):
    n, *a = map(int, string.split())
    count = 0
    for _a in a:
        tmp = _a
        while tmp % 2 == 0:
            tmp /= 2
            count += 1
    return str(count)


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))

Submission status: Accepted

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

ans = 0

while(1):
    f = 0
    for i in range(n):
        if a[i] % 2 == 0:
            a[i] /= 2
            ans += 1
        elif a[i] % 2 != 0:
            f += 1
    if f == n:
        print(ans)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

n2= 0
for num in A:
    while num%2 == 0:
        n2 += 1
        num /= 2
else:
    print(n2)

Submission status: Accepted

Solution code:
input = open(0).read

N, *an = map(int, input().split())


def main():
    ans = 0

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

        ans += tmp

    print(ans)
    return


main()

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
j=0
while len(a)!=0:
    a = [i/2 for i in a if i%2==0]
    j +=len(a)
print(j)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

def bi(num):
    n = 0
    while not num % 2:
        num = num / 2
        n += 1
    return n

print(sum(map(bi, lis)))

Submission status: Accepted

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

n = int(input())
a_list = list(map(int, input().split(" ")))
print(sum([num_of_2(x) for x in a_list]))