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:
import sys
import math
import itertools
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 L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
a = l()
ans = 0
for i in range(N):
    for j in range(100):
        if a[i]%2 == 0:
            ans += 1
            a[i] = a[i]//2
        else:
            break
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:
        cnt += 1
        a /= 2
print(cnt)
# Aのそれぞれの要素の2で割り切れる回数の和

Submission status: Accepted

Solution code:
from collections import Counter

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

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

ans = 0

for i in a:
    ans += prime_factorize(i)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## C - *3 or /2
cnt = 0
N = int(input())
A = list(map(int, input().split()))
for a in A:
    while a % 2 == 0:
        cnt += 1
        a /= 2
print(cnt)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

def l(x):
  k = 0
  while True:
    if x % 2==0:
      k += 1
      x = x//2
    else:
      break
  return(k)

ans = 0
for i in range(n):
  ans += l(A[i])
  
print(ans)

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

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

print(sum(num_f2))

Submission status: Accepted

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

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

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

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

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

print(cnt)

Submission status: Accepted

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

ans = 0


def canDiv(val):
    cnt = 0
    while True:
        if val % 2 == 0:
            cnt += 1
            val //= 2
        else:
            return cnt


for a in alist:
    ans += canDiv(a)

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in 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,b,n=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

def div2(v):
    res=0
    if v==0:
        return res
    while v%2==0:
        v=v//2
        res+=1
    return res
ans=0
for ai in al:
    ans+=div2(ai)
print(ans)

Submission status: Accepted

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

count = 0
for i in range(len(a)):
    aa = a[i]
    while True:
        b,c = divmod(aa,2)
        if c != 0:break
        count += 1
        aa = b
print(count)

Submission status: Accepted

Solution code:
_ = 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)

Submission status: Accepted

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

cnt=0
for i in x:
  j=1
  while(1):
    if i%2:
      break
    elif i:
      cnt+=1
      i//=2
    else: break
    j+=1
print(cnt)

Submission status: Accepted

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

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

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

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

ans=0
for i in a:
  ans+=tw(i)

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

Submission status: Accepted

Solution code:
from functools import lru_cache

@lru_cache(maxsize=None)
def rec_div(i):
    if i < 2:
        return 0
    a, b = divmod(i, 2)
    if b == 0:
        return rec_div(a) + 1
    else:
        return 0
n = input()
l = map(lambda x: rec_div(int(x)), input().split())
print(sum(l))

Submission status: Accepted

Solution code:
N = int(input())
*A, = 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()))
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] //= 2
        ans += 1
print(ans)

Submission status: Accepted

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


def prime_factorize_n2(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.count(2)


cnt = 0
for i in a:
    if i % 2 == 0:
        cnt += prime_factorize_n2(i)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
#10
a = [int(i) for i in input().split()]
#2184 2126 1721 1800 1024 2528 3360 1945 1280 1776

ans = 0
sm = 0
for aa in a:
	t = aa
	while t % 2 == 0:
		t = t // 2
		sm += 1

print(sm)

Submission status: Accepted

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

res = 0
for v in a:
    while v % 2 == 0:
        v //= 2
        res += 1

print(res)

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

Submission status: Accepted

Solution code:
n=(int)(input())
a=list(map(int, input().split(" ")))
count=0
ans=0
while(count!=len(a)):
  if a[count] % 2 == 0:
    a[count] = a[count] // 2
    ans += 1
  else:
    count += 1
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
s = list(map(int, input().split()))
n=s[0]
s = list(map(int, input().split()))
ans=0
for i in s:
    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 True:
        if a[i] % 2 == 0:
            ans += 1
            a[i] = a[i] / 2
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
def main():
    num = int(input())
    x_list = list(map(int, input().split()))
    ans = 0

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

    print(ans)

    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = 0
temp = 0
for n in range(N):
  x = 0
  temp = A[n]
  while x == 0:
    if temp % 2 == 0:
      ans += 1
      temp = temp //2
    else:
      x = 1
print(ans)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
#a,b=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
count=0
for a in al:
    temp=0
    v=a
    while v%2==0:
        v=v//2
        temp+=1
    count+=temp

print(count)

Submission status: Accepted

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

odd=[0]*n
j=0

for i in a:
    while i%2==0:
        odd[j]+=1
        i//=2
    j+=1
print(sum(odd))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
odd = [i for i in a if i % 2 != 0]
even = [i for i in a if i % 2 == 0]
result = []
count = 0
while True:
  for i in even:
    if i != 0 and i % 2 == 0:
      result.append(i//2)
      count += 1
  if not result:
    print(count)
    exit()
  even = result
  result = []

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
aaa = list(map(lambda x: format(int(x), 'b')[::-1].find('1'), input().split()))
print(sum(aaa))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def div2(N):
  if(N % 2 != 0):
    return 0
  else:
    i = 0
    while N % 2 == 0:
      N/= 2
      i+= 1
    return i
  
N = int(input())
lista = list(map(int, input().split()))

ans = 0
for x in lista:
  ans+= div2(x)
  
print(ans)

Submission status: Accepted

Solution code:
# C - *3 or /2
# https://atcoder.jp/contests/abc100/tasks/abc100_c

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

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

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
T=0
for i in L:
	if i%2==0:
		for j in range(1,40):
			if i%2**j!=0:
				T+=j-1
				break
print(T)

Submission status: Accepted

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

ans = 0
for a in A:
    if a % 2 == 1:
        continue

    ans += format(a, 'b')[::-1].find('1')
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())
    a=list(map(int,readline().split()))
    cnt=0
    for i in range(n):
        while a[i]%2==0:
            a[i]//=2
            cnt+=1
    
    print(cnt)

if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

cnt = 0

def count_even(x):
    global cnt
    while x % 2 == 0:
        cnt += 1
        x //= 2

for i in a:
    count_even(i)

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

Submission status: Accepted

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


N = int(input())
print(sum(map(lambda x: log2(int(x)), input().split())))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import *

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def divide_two(x,c=0):
  if x % 2 == 1:
    return c
  else:
    return divide_two(x//2,c+1)

b = (divide_two(x) for x in a)

print(sum(list(b)))

Submission status: Accepted

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

cnt = 0
for i in l:
    while i%2 == 0:
        cnt += 1
        i//=2

print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.array(lr())
answer = 0
while np.any(A%2==0):
    answer += (A%2==0).sum()
    A[A%2==0] //= 2

print(answer)

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] = A[i] // 2
        else:
            break

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()))
cnt=0

def f(x):
  tmp=0
  while x%2==0:
    tmp+=1
    x=x/2
  return tmp

for i in range(n):
  cnt+=f(A[i])
 
print(cnt)

Submission status: Accepted

Solution code:
import sys

start = 0
for l in sys.stdin:
    if start == 0:
        start += 1
    else:
        list1 = list(map(int, l.split()))
        break
count = 0
for i in list1:
    while True:
        if i%2 == 0:
            count += 1
            i = i/2
        else:
            break
print(count)

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()
a = nl()

ans = 0

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

print(ans)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

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

fac2num = []
for a in A:
    c = 0 
    while a%2 == 0:
        a //= 2
        c += 1
    fac2num.append(c)
print(sum(fac2num))

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# ans

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 ai in a:
    for i in reversed(range(1, 30)):
        if ai % pow(2, i) == 0:
            ans += i
            break
print(ans )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def log2(n):
    n = int(n)
    cnt = 0
    while ~n & 1:
        cnt += 1
        n >>= 1
    return cnt


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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = []
count = 0
for a in A:
    if a % 2 == 0:
        B.append(a)

for i in B:
    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()))
count = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import log2

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

ans = 0

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

Submission status: Accepted

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

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

print(int(ans))

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()
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:
from math import log2

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

ans = 0

for i in range(len(a)):
    tmp = a[i]
    while a[i]%2 != 1:
        if 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()))
import math
ans = 0
for i in range(N):
  a = A[i]
  b = int(math.log2(a))+1
  for j in range(b):
    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 a:
    while i % 2 == 0:
        i = i // 2
        cnt += 1

print(cnt)

Submission status: Accepted

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

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:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

    even = [A[i] for i in range(n) if A[i] % 2 == 0]

    res = 0
    for number in even:
        while number % 2 == 0:
            res += 1
            number //= 2

    print(res)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  ans = 0
  for x in a:
    ans += calc(x)
  print(ans)
  return

if __name__ == "__main__":
  resolve()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
import math

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

#print(a)

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

print(m)

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = filter(lambda x: x%2 == 0,map(int,input().split()))
C = collections.Counter(A)
ans = 0
for key in C.keys():
    tmp = key
    count = 0
    while tmp%2 == 0:
        tmp //= 2
        count += 1
    ans += C[key]*count
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int,input().split()))
A = [i for i in s if i % 2 == 0]

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

print(count)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# For taking integer inputs.
import math


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


def getn(n):
    c = 0
    while n % 2 == 0:
        n = n // 2
        c += 1
    return c


N = inp()
a = inlist()
c = 0
for i in a:
    c += getn(i)

print(c)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
def div2(m):
    i = 0
    while m % 2 == 0:
        m = m // 2
        i += 1
    return i
total = 0
for j in a:
    total += div2(j)
print(total)

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)