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

seki = 1

for a_i in A:
        seki *= a_i
'''
count = 0

while seki % 2 == 0:
        seki = seki // 2
        count += 1
'''

count = 0

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

Submission status: Accepted

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

for a_i in A:
        seki *= a_i

count = 0

while seki % 2 == 0:
        seki = seki // 2
        count += 1
'''

count = 0

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

Submission status: Accepted

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

mul = [0] * n

for i in range(n):
	for j in range(1, 31):
		if ls[i] % (2 ** j) != 0:
			mul[i] = j - 1
			break

print(sum(mul))

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
N=int(input())
A=list(map(int,input().split()))
ans=0
def tw(n):
    cnt=0
    while True:
        if n%2==0:
            n=n//2
            cnt+=1
        else:
            return cnt
for i in range(N):
    #print(tw(A[i]))
    ans+=tw(A[i])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

ans = 0
for x in a:
    current = x
    while current % 2 == 0:
       ans += 1
       current /= 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 True:
        if a[i]%2==0:
            a[i]=a[i]//2
            ans+=1
        else:
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

def factorization(n):
    arr = {}
    temp = n
    i = 2
    if temp % i == 0:
        cnt = 0
        while temp % i == 0:
            cnt += 1
            temp //= i
        arr[i] = cnt

    return arr

ans = 0
for a in A:
    arr = factorization(a)
    if 2 in arr:
        ans += arr[2]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

for i in a:
    num = i
    cnt+=format(num, 'b')[::-1].find('1')

print(cnt)

Submission status: Accepted

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

count = 0

for n in numbers:
  while(n % 2 == 0):
    n //= 2
    count +=1

print(count)

Submission status: Accepted

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


for i in a:
    while not i%2:
        i//=2
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in a:
  keta = int(math.log2(i))+1
  for j in range(keta):
    if (i >> j & 1) != 0:
      cnt += j
      break
print(cnt)

Submission status: Accepted

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

"""素因数分解"""
def factrize(n):
    b = 2
    fct = []
    while b*b <= n:
        while n % b == 0:
            n //= b
            #もし素因数を重複させたくないならここを加えてfct.append(b)を消す
            """
            if not b in fct:
                fct.append(b)
            """
            fct.append(b)
        b = b+1
        break
    return len(fct) #リストが帰る

ans = 0

for i in lst1:
    if i == 2:
        ans += 1
    else:
        ans += factrize(i)

print(ans)

Submission status: Accepted

Solution code:
import sys

n, *a = map(int, sys.stdin.read().split())

def main():
    cnt = 0
    for i in a:
        while not i % 2:
            i //= 2
            cnt += 1
    
    return cnt
    
if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

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


def solve(N: int, a: "List[int]"):
    answer = 0
    for i in range(N):
        while a[i]%2 == 0:
            answer += 1
            a[i] //= 2
    
    print(answer)
    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:


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

def trial_division(n):
  #素因数を格納するリスト
  counter = 0
  while n % 2 == 0:
      n //= 2
      counter += 1
  return counter

result = 0

for a in A:
  if a % 2 != 0: continue
  if a == 2:
    result += 1
  else:
    result += trial_division(a)

print(result)

Submission status: Accepted

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

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:
import sys
input = sys.stdin.readline
N = int(input())
li = [int(i) for i in input().split()]
sum = 0
a = 1
for i in range(N) :
    while(a) :
        if li[i]%2 == 0 :
            sum +=1
            li[i]/=2
        else :
            break
print(sum)

Submission status: Accepted

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

B = []
for a in A:
    if(format(a, 'b')[::-1].find('1') >= 1):
        B.append(format(a, 'b')[::-1].find('1'))

print(sum(B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# データ読み込み

import sys
from collections import deque

def input_data(d=""):
  t = sys.stdin.read()
  if t:
    return t
  else:
    if d[0] == "\n":
      d = d[1:]
    if d[-1] == "\n":
      d = d[:-1]    
    return d

A, *B  = map(int,input_data().split())

out = 0
for i in B:
  d = i
  while d % 2 == 0:
    d = d / 2
    out += 1

print(out)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in num_list:
    while i % 2 == 0:
        ans += 1
        i = i / 2

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
import math
s=list(map(int, input().split()))
count=0
for num in s:
    while True:
        if num%2==0:
            num=math.ceil(num/2)
            count+=1
        else:
            break
print(count)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    if i%2 == 0:
        c = 0
        for l in range(30):
            i /= 2
            c += 1
            if i%2 != 0:
                ans += c
                break
print(ans)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import math
import numpy as np
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append(format(a[i], 'b')[::-1].find('1'))
    
print(sum(b))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

# code here
# a, b = map(int, input().strip().split())
n = int(input())
N = map(int, input().strip().split())

s = 0
for n in N:
    c = 0
    d, r = divmod(n, 2)

    while r == 0:
        d, r = divmod(d, 2)
        c += 1
    s += c

print(s)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 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 main():
    N = I()
    A = LI()
    cnt = 0
    for a in A:
        while a % 2 == 0:
            a = a//2
            cnt += 1
    print(cnt)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in A:
    if x % 2 == 0:
        count += 1
        A.append(x / 2)

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

def solve(N: int, a: "List[int]"):
    # 素因数分解して，2の個数 == ans
    def factorization(n):
        factor = []
        n_ = n
        for i in range(2, int(math.sqrt(n) + 1)):
            if i == 3:
                break
            if n_ % i == 0:
                cnt = 0
                while n_ % i == 0:
                    n_ = n_ // i
                    cnt += 1
                factor.append([i, cnt])
        if n_ != 1:
            factor.append([n_, 1])
        if n == []:
            factor.append([n, 1])
        return factor

    ans = 0
    for ai in a:
        factor = factorization(ai)
        if factor[0][0] == 2:
            ans += factor[0][1]

    print(ans)

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=list(map(int,input().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()))
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:
import sys
import numpy as np
input = sys.stdin.readline
N = int(input())
a = [int(x) for x in input().split()]
ans = 0
for i in a:
    cnt = 0
    while i % 2 == 0:
        cnt += 1
        i //= 2
    ans += cnt
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]=int(a[i]/2)
        ans+=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
n = int(readline())
def two(a):
  c = 0
  while not (a & 1):
    c += 1
    a >>= 1
  return c
slst = sum([two(int(i)) for i in readline().split()])
print(slst)

Submission status: Accepted

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

input()
a=list(map(int,input().split()))
ans=0
for num in a:
  ans+=ct_2(num)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def even(n):
	ret = 0
	while n%2==0:
		n=n//2
		ret+=1
	return ret
ans=0
for i in range(N):
	ans+=even(A[i])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
evens = [x for x in a if x%2 == 0]

ans = 0
for x in evens:
    while x%2 == 0:
        x //= 2
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for _ in range(30):
    ans += sum([(a - 1) % 2 for a in A])
    A = [a // 2 for a in A if a % 2 == 0]

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
input()
a = [int(i) for i in input().split()]
ans = 0
for i in a:
  ai = i
  for j in range(i):
    if ai % 2 == 0:
      ans += 1
      ai //= 2
    else:
      break
print(ans)

Submission status: Accepted

Solution code:

def judge(a):
    ans=0
    while a%2==0:
        a/=2
        ans+=1
    return ans

if __name__ == '__main__':
    N=int(input())
    A=list(map(int,input().split()))
    count=0
    for a in A:
        count+=judge(a)

    print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import log2

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

res = 0

for num in L:
    l = num
    while (l % 2 == 0):
        res += 1
        l = l //  2
    
print(res)

Submission status: Accepted

Solution code:
import sys
import math

sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = MAP()

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

B = [devide(a) for a in A]
# print(B)

print(sum(B))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
N = int(N)
a = input()
a = a.split()
L = len(a)
b = []
ans = 0
flag = 1
for i in range(L):
    b.append(int(a[i]))
while(flag):
    flag = 0
    for i in range(N):
        if(b[i] % 2 == 0):
            ans = ans + 1
            b[i] = b[i] / 2
            flag = 1
print(ans)

Submission status: Accepted

Solution code:
def main(n: int, a: list):
    ans = 0

    for a in a:
        while True:
            a /= 2

            if a.is_integer():
                ans += 1
            else:
                break

    print(ans)


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

    main(n, a)

Submission status: Accepted

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

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

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()))
ans = 0
for i in a:
    ans += format(i, 'b')[::-1].find('1')
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

cnt = 0

for num in seq:
    while num % 2 == 0:
        cnt += 1
        num /= 2

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
a=[int(a) for a in input().split()]
rec=[False]*N
cnt=0
for b in range(35,0,-1):
    for i in range(N):
        if a[i]%(2**b)==0 and rec[i]==False:
            cnt+=b
            rec[i]=True
print(cnt)

Submission status: Accepted

Solution code:
#ABC 100C
import sys

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
#A.sort(reverse=True)

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

ans =0
for a in A:
    ans +=calc(a)

print(ans)

Submission status: Accepted

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

#output
import numpy as np
a = np.array(a)
a = a[a % 2 == 0]

def square_power(n, p):
    if n % 2**p == 0:
        return True
    else:
        return False

def is_possible(n):
    left = -1
    right = 30
    while left + 1 < right:
        mid = (left+right)//2
        if square_power(n, mid):
            left = mid
        else:
            right = mid
    return left

answer = 0
for b in a:
    answer += is_possible(b)

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
alis=list(map(int,input().split()))
counter=0
for i in range(1,31)[::-1]:
	for j in range(n):
		if alis[j]%(2**i)==0:
			alis[j]=alis[j]//(2**i)
			counter+=i
print(counter)

Submission status: Accepted

Solution code:
import sys
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
cnt = 0
for a in a_ls:
    while a % 2 == 0:
        a //= 2
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
num = int(input())
flag_list = [int(i) for i in input().split()]

ans = 0

for val in flag_list:
    while val % 2 == 0:
        val //= 2
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
num = int(input())
flag_list = [int(i) for i in input().split()]


ans = 0
cont_game = True

for val in flag_list:
    while val % 2 == 0:
        val //= 2
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
#全ての要素を奇数にできれば良い
#2で何回割れるか

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

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

print(k)

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().split()))

ans = 0
for i in range(N):
    tmp = a[i]
    while tmp % 2 == 0:
        tmp /= 2
        ans += 1
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 a:
  for j in range(1,32):
    if i % (2**j)==0:
      ans += 1
    else:
      break
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:
n = int(input())
L = list(map(int, input().split()))
E = []
for i in range(n):
  if L[i]%2 != 1:
    E.append(L[i])

out = 0    
for i in range(len(E)):
  out += bin(E[i])[::-1].find('1')
  
print(out)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
A = np.array(read().split(),np.int32)

answer = 0
for _ in range(32):
    A = A[A%2 == 0]
    answer += len(A)
    A >>= 1
print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def examC():
    N= I()
    A = LI()
    cur = 0
    for i in A:
        while(True):
            if i % 2 == 0:
                i //= 2
                cur += 1
            else:
                break
    print(cur)



import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

Submission status: Accepted

Solution code:
import numpy as np

N=int(input())
A=np.asarray(list(map(int,input().split(" "))))
csum=0 # 回数

# 全てが2で割り切れなくなるまで、2で割り続ける
while True:
    cond=(A%2==0) # 条件
    c=(cond).sum() # 回数
    csum+=c # 合計回数に足す

    if c==0: # もし2で割り切れなくなったら終了
        break

    A=A[cond]//2 # 2で割る

print(csum)

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

Submission status: Accepted

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

N=int(input())
L=list(map(int,input().split()))
L_div=[two_div(i) for i in L]
print(sum(L_div))

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
*A,= 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:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
l = [2**i for i in range(29, -1, -1)]
ans = 0
for i in range(N):
    flag = False
    for j in range(len(l)):
        if A[i] % l[j] == 0 and flag==False:
            ans += 29 - j
            flag = True
print(ans)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

def main():
    N = int(input())
    
    ans = 0
    
    for a in list(map(int, input().split())):
        while not a % 2:
            ans += 1
            a //= 2
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
    while a % 2 == 0:
        a /= 2
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

total_count = 0
for i in range(n):
    total_count += check_two(a[i])

print(total_count)