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())
List = list(map(int, input().split()))
res = 0
flagWhile = True
flagManip = True
for i in range(N):
  while List[i] % 2 == 0:
    List[i] = List[i] //2
    res += 1

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
int_n = int(input())
li_a = list(map(int, input().split()))

answer = 0
for a in li_a:
    wk = a
    while wk % 2 == 0:
        wk = wk // 2
        answer += 1
print(answer)

Submission status: Accepted

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

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

ans = 0
for a in A:
    ans += f(a)
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:
import math 
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())
a = list(map(int, input().split()))
cnt=0
for i in range(N):
  v = a[i]
  while 1:
    if v%2==0:
      v=v//2
      cnt+=1
    else:
      break

print(cnt)

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

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

count = 0
for a in an:
    while True:
        if a % 2 != 0:
            break
        a = a /2
        count += 1

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def num_divide_two(num: int):
    return int(format(num, 'b')[::-1].find("1"))

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

Submission status: Accepted

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

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



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

ret = 0
for a in A:
    ret += factorization(a)

print(ret)

Submission status: Accepted

Solution code:
n,r = int(raw_input()), 0
ais = map(int ,raw_input().split())
for ai in ais:
	while(ai % 2 == 0 ):
		ai /= 2
		r += 1
print r

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

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

# 全要素の因数に2が何個あるかを数える問題

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

import collections
count = 0
for a in A:
    count += collections.Counter(prime_factorize(a))[2]
    
print(count)

Submission status: Accepted

Solution code:
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
ans = 0

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


print(ans)

Submission status: Accepted

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

def count(x):
    res=0
    while x%2==0:
        res+=1
        x=x//2
    return res
ans=0
for i in range(n):
    ans+=count(a[i])

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(count2(a))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def numOftwo(x):
    cnt = 0
    while x%2 == 0:
        x //= 2
        cnt += 1
    return cnt

def main():
    N = int(readline())
    a = [int(i) for i in readline().split()]
    s = 0
    for i in range(N):
        s += numOftwo(a[i])
    print(s)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
c = 0
for a in A:
    c += bin(a)[2:][::-1].index("1")
print(c)

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

Solution code:
def Div2Count(N):
    Count = 0
    while N%2==0:
        N = N//2
        Count += 1
    return Count
  
N = int(input())
A = [Div2Count(int(X)) for X in input().split()]
print(sum(A))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    A = LI()
    cnt = 0
    for a in A:
        while a%2 == 0:
            cnt += 1
            a //= 2
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
la = [int(w) for w in input().split()]

mrb = [math.log2(b & -b) for b in la]
print(int(sum(mrb)))

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 a_i in a:
    a_i_tmp = a_i
    while a_i_tmp % 2 == 0:
        ans += 1
        a_i_tmp /= 2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
cnt=0
f=True
while f:
	for i in range(n):
		if a[i]>2 and a[i]%2==0:
			a[i]=a[i]//2
			cnt+=1
		else:
			a[i]=3*a[i]
			
	for ai in a:
		if ai%2==0:
			break
	else:
		f=False
			
print(cnt)

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, 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()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

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




if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
print(sum(bin(i)[::-1].find("1") for i in [*map(int, open(0).read().split())][1:]))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
c = 0
for i in a:
    b = bin(i)
    c += len(b) - 1 - b.rfind('1')
print(c)

Submission status: Accepted

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

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

ans = 0
for i in range(N):
    ans += bin(A[i])[::-1].find('1')
print(ans)

Submission status: Accepted

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

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

L = []
for i in range(N):
    n = bin(A[i])[::-1].find('1')
    if n != 0:
        L.append(n)
if not L:
    print(0)
else:
    print(sum(L))

Submission status: Accepted

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

a_=[0]*N
for a_idx,a in enumerate(A):
    n=0
    while a%2 == 0:
        n+=1
        a=a/2
    a_[a_idx] = n
    
print(sum(a_))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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:
# C - *3 or /2

N = int(input())
A = list(int(a) for a in input().split())

def devide2(x):
    if x%2:
        return 0
    else:
        ret = 0
        while True:
            ret += 1
            x //= 2
            if x%2:
                return ret

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = i()
a = l()

for i in range(N):
    if a[i] % 2 == 0:
        while a[i] % 2 == 0:
            a[i] //= 2
            count += 1
    else:
        pass

print(count)

Submission status: Accepted

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

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

ans = 0
for i in range(len(A)):
    ans += TwoNumber(A[i])

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:
import sys
read = sys.stdin.read
def main():
    n, *a = map(int, read().split())
    r = 0
    for ea in a:
        while True:
            if ea % 2 == 0:
                r += 1
                ea //= 2
            else:
                break
    print(r)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    A = in_nl()

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


def solve(N: int, a: "List[int]"):
    def f(n):
        res = 0
        while n % 2 == 0:
            n //= 2
            res += 1
        return res
    return sum(map(f, a))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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]"
    print(solve(N, a))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, 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()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N = ii()
    A = il()
    ret = 0
    for n in range(N):
        while A[n] % 2 == 0:
            A[n] //= 2
            ret += 1
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

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

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

A =[0]

for i in a:
  A.append(count_2(i))
  
print(sum(A))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    As = list(map(int, input().split()))

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

ret = 0

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

print(ret)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, *a = map(int, open(0).read().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()))
count = 0
for i in range(n):
    while a[i] % 2 == 0:
        a[i] //= 2
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if __name__ == "__main__":
    N = int(input())
    a = list(map(int, input().split()))
    solve()

Submission status: Accepted

Solution code:
from collections import defaultdict
import bisect

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
a = readInts()
ans = 0
for i in range(n):
	while 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())
a=list(map(int,input().split()))

c=0

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

Submission status: Accepted

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def resolve():
    N = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in a:
        ans += prime_factorize(i).count(2)

    print(ans)

    return

resolve()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def count_check(n):
    result = 0
    while n % 2 == 0:
        n /= 2
        result += 1
    return result

def main():
    n = i_input()
    num_list = i_list()

    count = 0 

    for num in num_list:
        if num % 2 != 0:
            continue
        count += count_check(num)

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

Submission status: Accepted

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


def resolve():
    N = int(input())
    A = [int(i) for i in input().split()]
    sumA = 0
    for a in A:
        sumA += prime2_factorize(a)
    print(sumA)


resolve()

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

cnt = 0
nlis = []

for i in lis:
    if i % 2 == 0:
        nlis.append(i)

if nlis == []:
    print(0)
    exit()
else:
    for m in nlis:
        while m > 1:
            m //= 2
            cnt += 1
            if m % 2 == 1:
                break

print(cnt)

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

Submission status: Accepted

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


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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
def k(a):
    if a%2==1:
        return 0
    return k(a/2)+1
print(sum([k(a) for a in l]))

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
tmp = 0

for i in range(N):
  if a[i]%2 == 0:
    while a[i]%(2**tmp) ==0:
      tmp = tmp + 1
    cnt = cnt + tmp -1
    tmp = 0
print(cnt)

Submission status: Accepted

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

ans=0
for i in range(n):
    flag=True
    while flag:
        if a[i]%2==0:
            a[i]=a[i]/2
            ans+=1
        else:
            flag=False
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:
#!/usr/bin/env python
# coding: utf-8

# In[18]:


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


# In[19]:


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


# In[ ]:

Submission status: Accepted

Solution code:
def mi():
    return map(int, input().split())

def ii():
    return int(input())

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


def main():
    N = ii()
    a = list(mi())
    print(sum(map(div2, a)))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

count=[0]*n

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

print(sum(count))

Submission status: Accepted

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

Submission status: Accepted

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

tmp = [i for i in nums if i % 2 == 0]
count = 0
for i in tmp:

    while i % 2 == 0:
        count += 1
        i //= 2

print(count)

Submission status: Accepted

Solution code:
import numpy as np
 
n = int(input())
a =list(map(int, input().split()))
b = 0
for i in range(n):
  for j in range(30):
    if(a[i]%2==0):
      a[i] = a[i]/2
      b+=1
    else:
      break
print(b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
a = list(map(int,input().split()))
ans=0
for x in a:
    if x%2!=0:
        continue
    for j in range(1,50):
        if x%2**j!=0:
            ans+=j-1
            break
print(ans)

Submission status: Accepted

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

for x in a:
  if x%2!=0:
    continue
  for j in range(1,50):
    if x%2**j!=0:
      ans+=j-1
      break
print(ans)