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 num in a_list:
  while True:
    if num % 2 != 0:
      break
    num //= 2
    count += 1

print(count)

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def connt_half(n):
    return (n ^ (n - 1)).bit_length() - 1

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


ans = 0
for v in a:
    ans += connt_half(v)
# 出力
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
import numpy as np

def prime_factorize(n):
	a = 0   
	while n % 2 == 0:
		a+=1
		n //= 2
	return a

N =int(input())

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

ans_array = np.zeros(N)

for i in range(N):
    dummy = prime_factorize(a[i])
  
    ans_array[i] = dummy
ans = int(sum(ans_array))
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
num=list(map(int,input().split()))
cnt=0
def cnt_2(n):
  cnt=0
  while n>1:
    if n%2==0:
      n//=2
      cnt+=1
    else:
      break
  return cnt
    
for i in num:
  cnt+=cnt_2(i)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections


class Solution:
    def solve(self, N: int, a) -> int:

        def numFactor(n: int, d: int) -> int:
            if d < 2:
                return -1
            else:
                cnt = 0
                tmp = n
                while tmp % d == 0:
                    cnt += 1
                    tmp //= d

                return cnt

        answer = 0

        for ai in a:
            answer += numFactor(ai, 2)

        return answer


if __name__ == '__main__':

    # standard input
    N = int(input())

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

    # solve
    solution = Solution()
    ans = solution.solve(N, a)

    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

bases = []
i = 1
while True:
    i = i * 2
    if i < 1000000000:
        bases.append(i)
    else:
        break

bases.reverse()

ans = 0
for ai in a:
    for i, base in enumerate(bases):
        if ai % base == 0:
            ans += len(bases) - i
            break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
answer = 0
# def prime_decomposition(n):
#   i = 2
#   table = []
#   while i * i <= n:
#     while n % i == 0:
#       n /= i
#       table.append(i)
#     i += 1
#   if n > 1:
#     table.append(n)
#   return table
def count2(n):
    count = 0
    while True:
        if n % 2 == 0:
            n //= 2
            count += 1
        else:
            break
    return count  

for ai in a:
    # print(prime_decomposition(ai))
    # print(prime_decomposition(ai).count(2))
    answer += count2(ai)

print(answer)

Submission status: Accepted

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

  total = 0
  for i in ni:
    while not i%2:
      i //= 2
      total += 1
  print(total)

Submission status: Accepted

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

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

Submission status: Accepted

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

def cnt_div2(n):
    cnt=0
    while n%2==0:
        n//=2
        cnt+=1
    return cnt

#各要素に対して，2で割ることのできる回数をカウント
lis = [cnt_div2(i) for i in a]
print(sum(lis))

Submission status: Accepted

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

def bai(n):
  cnt = 0
  while n % 2 == 0:
    n = n // 2
    cnt += 1
  return cnt

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

Submission status: Accepted

Solution code:
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics


# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

def gettwice(n):
    counter = 0
    flg = True
    while (flg):
        if n % 2 == 1:
            flg = False
        else:
            n = n / 2
            counter += 1

    return counter


n = getInputInt()
data = getInputListInt()

ans = 0

for i in range(len(data)):
    ans += gettwice(data[i])

print(ans)

Submission status: Accepted

Solution code:
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics


# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

def gettwice(n):
    counter = 0
    flg = True
    while (flg):
        if n % 2 == 1:
            flg = False
        else:
            n = n / 2
            counter += 1

    return counter


k = getInputInt()
data = getInputListInt()

ans = 0

for i in range(len(data)):
    ans += gettwice(data[i])

print(ans)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

total = 0
for i in ni:
  while not i%2:
    i //= 2
    total += 1
print(total)

Submission status: Accepted

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

def f(i):
  cnt = 0
  while not i%2:
    i //= 2
    cnt += 1
  return cnt
total = 0
for i in ni:
  total += f(i)
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
 
def f(n):
  cnt = 0
  while(n%2==0):
    n = n//2
    cnt +=1
  return cnt
 
total = 0
for e in a:
  total += f(e)
print(total)

Submission status: Accepted

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

count = 0

for i in range(0, 30):
    for j in range(N):
        if int(a_list[j]) % 2 == 0:
            a_list[j] = int(int(a_list[j]) / 2)
            count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    numbers = list(map(int, input().split(" ")))
    answer = 0
    odds = 0
    while odds < N:
        odds = 0
        for i in range(N):
            if not numbers[i] % 2:
                numbers[i] //= 2
                answer += 1
            else:
                odds += 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

N = int(input())
numbers = [int(i) for i in input().split() if int(i) % 2 == 0]

cnt = 0
for n in numbers:
    cnt += divisionCnt(n)

print(cnt)

Submission status: Accepted

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

for i in range(1,31):
  for j in range(n):
    if a[j] % (2**i) == 0:
      ans += 1
      
print(ans)

Submission status: Accepted

Solution code:
def time2(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans
N = int(input())
LA = list(map(int, input().split()))
sum = sum(map(time2, LA))
print(sum)

Submission status: Accepted

Solution code:
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
a=list(map(int,input().split()))
ans=0
cal=[2**i for i in range(29,0,-1)]
for i in a:
    for num,j in enumerate(cal):
        if i%j==0:
            ans+=29-num
            break
print(ans)

Submission status: Accepted

Solution code:
def warizan(n):
    flag = True
    count = 0
    while flag == True:
        if n/2 == n//2:
            count += 1
            n = n/2
        else:
            flag = False
    return count

import math
n = int(input())
lis = list(map(int, input().split()))
new_lis = [warizan(l) for l in lis if l%2 == 0]
print(sum(new_lis))

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

Submission status: Accepted

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

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

total = 0
for e in a:
  total += f(e)
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())

    ans = 0
    for a in filter(lambda x: x % 2 == 0, map(int, input().split())):
        i = a
        while i % 2 == 0:
            i //= 2
            ans += 1

    print(ans)
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ord(N,n):#N,nは正の整数、Nで割り切れる回数
    if n%N!=0:
        return 0
    else:
        return 1+ord(N,n//N)

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

m=0
for i in range(0,N):
    m=m+ord(2,a[i])
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def cnt(x):
    if x%2==1:
        return 0
    else:
        return cnt(x//2)+1
for i in range(n):
    ans+=cnt(a[i])
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

count = 0

for s in seq:
    while s % 2 == 0:
        count += 1
        s /= 2

print(count)

Submission status: Accepted

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

ans = 0

for i in a:
    ii = i
    while ii > 0 and ii % 2 == 0:
            ans += 1
            ii /= 2

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a2 = [i for i in a if i%2==0]
ans = 0
def saiki(i):
    if i == 1 or i%2 != 0:
        return 1
    return 1 + saiki(i//2)
if len(a2)==0:
    print(0)
else:
    for i in a2:
        ans += saiki(i//2)
    print(ans)

Submission status: Accepted

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

def two(n):
	count = 0
	while n%2 == 0:
		n = n/2
		count += 1
	return count
	
l = []
for i in range(n):
	l.append(two(a[i]))
	
print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, *a = map(int, open(0).read().split())

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = 0
def keta2(n):
    count = 0
    while(1):
        if n % 2 == 0:
            count += 1
            n = n //2
        else:
            break
    return count

for i in range(N):
    if a[i] % 2 == 0:
        ans += keta2(a[i])
print(ans)

Submission status: Accepted

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

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

def f(n):
  res = 0
  while n % 2 == 0:
    n //= 2
    res += 1
  return res

answer = 0
for a in A:
  answer += f(a)

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import log2, ceil

def solve(n, A):
    def count_div2(m):
        if m % 2 == 1:
            return 0
        l, r = 0, ceil(log2(m)) + 1
        while r - l > 1:
            p = (r + l) // 2
            if m % (2 ** p) == 0:
                l = p
            else:
                r = p
        return l
    return sum(count_div2(a) for a in A)

_n = int(input())
_A = map(int, input().split())
print(solve(_n, _A))

Submission status: Accepted

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


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


for num in nums:
    ans += count(num)
print(ans)

Submission status: Accepted

Solution code:
number = int(input())

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

print(ans)

Submission status: Accepted

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

c = 0
for ii in range(n):
  c += format(a[ii],"b")[::-1].find("1")
print(c)

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n = ni()
a = na()

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N = int(sys.stdin.buffer.readline())
A = list(map(int, sys.stdin.buffer.readline().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]

class Util():
    def round_up(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Util.round_up(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x

N = cin.int()
A = cin.mapInt()

ans = 0
for x in A:
    ans += format(x,"b")[::-1].find("1")
print(ans)

Submission status: Accepted

Solution code:
n = int(input().strip())
a = list(map(int, input().split()))
print(sum([format(num, 'b')[::-1].find('1') for num in a]))

Submission status: Accepted

Solution code:
n = int(input().strip())
a = list(map(int, input().split()))
print(sum([format(num, 'b')[::-1].find('1') for num in filter(lambda x: x % 2 == 0, 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 //= 2
    ans += 1
print(ans)

Submission status: Accepted

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

ans = 0
while (1):
   b = [x % 2 for x in a]
   ans += b.count(0)
   if (0 not in b):
      break

   a = [int(a[i]/2) if b[i]==0 else a[i] for i in range(n)]

print(ans)

Submission status: Accepted

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


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


ans = 0
for aa in a:
    if aa % 2 == 0:
        ans += t(aa)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
def time2(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans
N = int(input())
LA = list(map(int, input().split()))
sum = sum(map(time2, LA))
print(sum)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

i = 0
count = 0

while i < n:
    if a[i]%2 == 0:
        a[i] = a[i] / 2
        count += 1
    else:
        i += 1

print(count)

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

Submission status: Accepted

Solution code:
def is_even(n):
    return n & 1 == 0

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


count = 0
for v in a:
    while is_even(v):
        v = int(v / 2)
        count += 1

print(count)

Submission status: Accepted

Solution code:
import math
N =int(input())
nums = [int(i) for i in input().split(' ')]

#print(nums)
ans =0
for i in nums:
  while(1):
    if i%2 == 0:
      ans += 1
      i //= 2
    else:
      break

print(ans)

Submission status: Accepted

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

t=0
c=0
while(N>c):
    if(A[c]%2==0):
        t+=1
        A[c]//=2
    else:
        c+=1
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

for i in A:
    for n in range(1,1000):
        if i % (2**n) == 0 :
            cnt += 1
        else:
            break
print(cnt)

Submission status: Accepted

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



def main():
    N = int(input())
    A = [int(x) for x in input().split()]

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

    print(ans)


    
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
int(input())
print(sum(map(lambda a: format(int(a), 'b')[::-1].index('1'), input().split())))

Submission status: Accepted

Solution code:
int(input())
print(sum(map(lambda a: format(int(a), "b")[::-1].index("1"), input().split())))

Submission status: Accepted

Solution code:
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()))
print(sum([format(A[i], 'b')[::-1].find('1') for i in range(N)]))

Submission status: Accepted

Solution code:
def main():
    _ = int(input())
    a = list(map(int,input().split()))
    count = 0
    for i in a:
        while True:
            if i%2 == 0:
                i = i//2
                count += 1
            else:
                break
    print(count)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N, *a = map(int, open(0).read().split())
    print(sum([bin(ai)[::-1].index("1") for ai in a]))
    return


main()

Submission status: Accepted

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

ans = 0
for _a in a:
    while _a%2 == 0:
        _a //= 2
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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