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:
from collections import *
from heapq import *
from itertools import *
from fractions import gcd

from decimal import *
import copy
from bisect import *
import time
import sys
import math
sys.setrecursionlimit(10**7)
N=int(input())
A=list(map(int,input().split()))
count=0
for a in A:
    while a%2==0:
        a//=2
        count+=1
print(count)

Submission status: Accepted

Solution code:
import numpy as np

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

i = 2
cnt = 0
mn = a.max()

while i < mn+1:
    tmp = a[a%i == 0]
    cnt += len(tmp)
    i = i*2

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  x=bin(a[i])[2:][::-1]
  for j in range(len(x)):
    if x[j]=='1':
      ans+=j
      break 
print(ans)

Submission status: Accepted

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

even_nums = [num for num in alist if num%2 == 0]
ans = 0
for num in even_nums:
  while(num%2 == 0):
    num = num / 2
    ans = ans + 1
print(ans)

Submission status: Accepted

Solution code:
#import sys
#input()=sys.stdin.readline()
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(len(a)):
    while True:
        if a[i]%2==0:
            a[i]/=2
            k+=1
        else:break
print(k)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
N, = map(int, input().split())
A = list(map(int, input().split()))
B = [0] * N
for i in range(N):
    a = A[i]
    c = 0
    while a:
        a, m = divmod(a, 2)
        if m:
            break
        c += 1
    B[i] = c
print(sum(B))

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    A = [int(a) for a in input().split()]
    count = 0
    for i in range(N):
        while A[i] % 2 == 0:
            count += 1
            A[i] //= 2
    print(count)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc100/tasks/abc100_c

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

Submission status: Accepted

Solution code:
def ABC67_B():
    N, K = LI()
    L = LI()
    L.sort(reverse=True)
    ans = sum(L[:K])
    print(ans)
    return

def ABC100_C():
    def factorization_2(n):
        arr = defaultdict(int)
        temp = n
        i = 2
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt
        if temp != 1:
            arr[temp] = 1
        if arr == []:
            arr[n] = 1
        return arr[2]
    N = I()
    A = LI()
    ans = 0
    for a in A:
        ans += factorization_2(a)
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
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()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    ABC100_C()

"""

"""

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():

    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)

resolve()

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:
def main():
    _ = int(input())
    A = [int(i) for i in input().split() if int(i) % 2 == 0]
    ans = 0
    while A and any(a % 2 == 0 for a in A):
        A = [a//2 for a in A if a % 2 == 0]
        ans += len(A)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n = INT()
a = LIST()
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 resolve():
    N = int(input())
    A = list(map(int, input().split(" ")))
    res = 0
    for a in A:
        while True:
            if a % 2 != 0:
                break
            res += 1
            a = a // 2
    print(res)

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:

from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
import numpy as np
from functools import reduce

from collections import deque, Counter, defaultdict
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import statistics
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
def lcm(a, b):
  return a*b//gcd(a, b)

def main():
  N = int(readline())
  A = list(map(int, readline().split()))
  ans = 0
  for j in range(N):
    i = A[j]
    while i%2==0:
      i //= 2
      ans += 1
  print(ans)
  
  
  
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

div2list=[]
for a in alist:
  cnt=0
  while(True):
    if a%2==1:
      break
    else:
      a//=2
      cnt+=1
  div2list.append(cnt)
  
print(sum(div2list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
a = list(map(int, input().split()))
result = 0
for el in a:
    flag = True
    while flag:
        if el % 2 == 0:
            el//=2
            result += 1
        else:
            flag = False
print(result)

Submission status: Accepted

Solution code:
#!python3

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


def p2(x):
    ret = 0
    while x % 2 == 0:
        ret += 1
        x //= 2
    return ret


def main():
    ans = 0
    for a in A:
        ans += p2(a)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
#print(n)
#print(a)
count=0
flag=True
while(flag):
    flag=False
    for i in range(n):
        while(a[i]%2==0):
            #print(i)
            #a=list(map(lambda x:x*3,a))
            a[i]=int(a[i]/2)
            #print(a)
            count+=1
            flag=True
            #break
print(count)
#たぶんリスト全部に3かけて該当を６で割ればよさそう
#３倍する必要がない

Submission status: Accepted

Solution code:
n, *A = map(int, open(0).read().split())
ans = 0
for a in A:
  while True:
    a, r = divmod(a, 2)
    if r == 1:
      break
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = input()
lst = [int(e) for e in input().split()]

count = 0
m = 0
f = True
while(f):
    f = False
    for i in range(m,len(lst)):
        if(lst[i]%2 == 0):
            m = i
            f = True
            break
    if(f):
        count += 1
    else:
        break

    lst[m] = int(lst[m]/2)

print(count)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

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

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:
import sys
input = sys.stdin.readline
n = int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
A = [int(i) for i in input().split()]
ans = 0
for num in A:
    while num % 2 == 0:
        num //= 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//=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:
  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()))
cnt=0
for i in range(n):
  k=0
  while 1:
    if a[i]%2==0:
      a[i]=a[i]//2
      k+=1
    else:break
  cnt+=k    
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

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

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

print(cnt)

Submission status: Accepted

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

A=[]
for i in range(N):
  if a[i]%2==0:
    A.append(a[i])

ans=0
for i in range(len(A)):
  for j in range(31):
    if A[i]%2==0:
      ans+=1
      A[i]//=2
    else:
      break
print(ans)

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


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

    N = ii()
    A = il()
    tmp = []
    for a in A:
        if a % 2 == 0:
            tmp.append(a)

    ans = 0
    for n in tmp:
        while n % 2 == 0:
            ans += 1
            n //= 2

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

cnt = 0
for i in range(n):
  for j in range(30):
    if array[i]%2 == 0:
      array[i] = array[i]//2
      cnt += 1
    else:
      break

print(cnt)

Submission status: Accepted

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

ans = 0

for c in list_A:
    while True:
        if c%2 != 0:
            break
        ans += 1
        c /= 2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ns = map(int, input().split())
result = 0
while ns:
    ns = [i//2 for i in ns if i%2 == 0]
    result += len(ns)
print(result)

Submission status: Accepted

Solution code:

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

ans = 0

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

for i in range(n):
    ans += div_2(a[i])

print(ans)

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
from collections import defaultdict          # subclass of dict. defaultdict(facroty)
from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
from heapq import heapify, heappush, heappop # heapify(L) changes list in-place in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(nlgk)=O(n).
from itertools import accumulate             # accumulate(iter[, f])
from functools import reduce                 # reduce(f, iter[, init])
from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
from fractions import gcd                    # for Python3.4.3


def main():
    input = sys.stdin.readline      # 改行文字が残ることに注意
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def ii():  return int(input())
    def mi():  return map(int, input().rstrip().split())
    def lmi(): return list(map(int, input().rstrip().split()))
    def li():  return list(input().rstrip())
    
    def count_divide_two(num, memo=0):
        if num % 2 == 1:
            return memo
        else:
            return count_divide_two(num//2, memo+1)
    
    _ = ii()
    a = lmi()
    ans = 0
    for elm in a:
        ans += count_divide_two(elm)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

for i in A:
    if i % 2 == 0:
        temp = i
        while temp % 2 == 0:
            ans += 1
            temp = int(temp / 2)

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
dd=[]                                                                  
for i in l: 
	if i % 2==0:
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
A2 = list(filter(lambda x: x%2==0, A))
count = 0

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

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def sanbun2(n , al):

    ans = 0

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

    return ans

def main():
    n = int(input())
    al = list(map(int , input().split()))
    print(sanbun2(n , al))

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

fac = [0] * N
for i in range(N):
    if a[i]%2==0:
        fac[i] = factorization(a[i])

print(sum(fac))

Submission status: Accepted

Solution code:
import math
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())
list = input().split()

i = 0
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
#print(n)
low = list(map(int,input().split()))
#print("INPUT = ")
#print(low)
count = 0
for i in range(n):
	tmp = int(low[i])
	while tmp % 2 == 0 and tmp !=0:
		tmp = tmp// 2
		count = count + 1
#		print("COUNT=", count, "TMP=",tmp)
#print("ANS = ")
print(count)

Submission status: Accepted

Solution code:
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

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

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

    print(cnt)

resolve()

Submission status: Accepted

Solution code:
N = int(input())
count_2 = 0

list_a = list(map(int,input().split(' ')))


for n in list_a:
  while n % 2 == 0:
    n /= 2
    count_2 += 1

print(count_2)

Submission status: Accepted

Solution code:


def solve():
    _ = int(input())
    ax = list(map(int, input().split()))
    ans = 0

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

    print(ans)


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

Submission status: Accepted

Solution code:
a = int(input())
num_list = list(map(int,input().split()))
count = 0
for i in num_list:
  count += format(i,"b")[::-1].find("1")
print(count)

Submission status: Accepted

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

a.sort(reverse=True)
even = []
for i in range(n):
    if a[i] % 2 == 0:
        even.append(a[i])

three = 0
for i in range(len(even)):
    sub = even[i]
    while sub % 2 == 0:
        three += 1
        sub = sub / 2

print(three)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split(' ')))
ans = 0
def num_2(x):
    res = 0
    while x%2==0:
        res += 1
        x/=2
    return res
for i in A:
    ans += num_2(i)
print(ans)

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 == 1:
        continue

    while A[i] > 1:
        if A[i] % 2 == 0:
            A[i] = A[i] // 2
            ans += 1
        else:
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

# N
n = int(input())

# an 数列
an = [list(map(int, input().split()))]

an_np = np.array(an)

num = 0

while True:
    if np.any(an_np % 2 == 0):
        an_np = an_np[an_np % 2 == 0] 
        num += len(an_np)
        an_np //= 2
    else:
        break
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


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

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

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


if __name__ == "__main__":
    main()