Problem:


Score: 300 points

Problem Statement

As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.

Snuke, an employee, would like to play with this sequence.

Specifically, he would like to repeat the following operation as many times as possible:

For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".  
Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.

At most how many operations can be performed?

Constraints

N is an integer between 1 and 10 \ 000 (inclusive).

a_i is an integer between 1 and 1 \ 000 \ 000 \ 000 (inclusive).

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 a_3 ... a_N

Output

Print the maximum number of operations that Snuke can perform.

Sample Input 1

3
5 2 4

Sample Output 1

3

The sequence is initially {5, 2, 4}. Three operations can be performed as follows:

First, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {15, 6, 2}.

Next, multiply a_1 by 3, divide a_2 by 2 and multiply a_3 by 3. The sequence is now {45, 3, 6}.

Finally, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {135, 9, 3}.

Sample Input 2

4
631 577 243 199

Sample Output 2

0

No operation can be performed since all the elements are odd. Thus, the answer is 0.

Sample Input 3

10
2184 2126 1721 1800 1024 2528 3360 1945 1280 1776

Sample Output 3

39



Sample input:
3
5 2 4


Sample output:
3

Submission status: Accepted

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


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

print(sum(map(two, A)))

Submission status: Accepted

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

ans = 0
for a in A:
    ans += bin(a)[::-1].index("1")
        
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
from copy import copy

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

# 1 <= N  <= 10000  O(N^2)
# 1 <= ai <= 10^9   O(ai)

def divider(n, p):
    # Return the number of p in n
    k = 0
    while n % p == 0:
        n = n / p
        k += 1
    return k

ks = []

for a in A:
    k = divider(a, 2)
    ks.append(k)

print(sum(ks))

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] = int(a[i]/2)

print(ans)

Submission status: Accepted

Solution code:
N = int(raw_input())
a = [int(x) for x in raw_input().split()]

count = 0

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def main():
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

count=0

for a in A:
    while (a%2) != 1:
        count+=1
        a = a/2

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def dl2(n):
    if n % 2 == 1:
        return 0
    else:
        return 1 + dl2(n/2)

def main():
    N = input().split(" ")
    t = input().split(" ")
    ans = 0
    for i in t:
        ans += dl2(int(i))
    print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]
arr01 = [x for x in arr if x % 4 ==0] 
arr02 = [x for x in arr if x % 4 !=0 and x % 2==0] 

cnt=0
if len(arr)>0:

    for i in arr01:

        while i % 2==0:

            i//=2
        
            cnt+=1
    
    cnt+=len(arr02)
   
print(cnt)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n=int(input())
v=map(int,input().split())
v=sorted(v)[::-1]
c=0
cnt=0
while 1:
    while 1:
        if v[c]%2:break
        cnt+=1
        v[c]/=2
    c+=1 
    if c>=n:break
print(cnt)

Submission status: Accepted

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


A = [bin(a)[2:] for a in A]
ans = sum([len(a) - (a.rfind("1") + 1) for a in A])

print(ans)

Submission status: Accepted

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

def C(a):
    return sum(list(map(div2count,a)))

n = input()
a = map(int,input().split())
print(C(a))

Submission status: Accepted

Solution code:
''' *3 or /2  '''
total = 0

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

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


def forl(num):
    count = 0

    if num%2==1:
        return 0

    while num%2 is 0 and num>1:
        count+=1
        num//=2
    
    return count

'''total+=forl(2)
total+=forl(4)'''

for i in ar:
    total+=forl(i)

print(total)

Submission status: Accepted

Solution code:
N = int(input())

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

li_even = []

for i in a:
    if i % 2 == 0:
        li_even.append(i)
    else:
        pass
count = 0
for num in li_even:
    while num % 2 == 0:
        num /= 2
        count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

#take input
n = int(input())

#Filter only the even number
list_a = [int(a) for a in input().split() if not int(a)%2 ]

numOps = 0

#iterate each element and divide by two over and over
for el in list_a:
    #1. check iteratively if divisible by two, then divide by two and count up
    while(el%2 == 0):
        el = el / 2
        numOps += 1

print(numOps)

Submission status: Accepted

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

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

print(sum([count_two(a_n) for a_n in a]))

Submission status: Accepted

Solution code:
import sys 
import math

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

print(count)

Submission status: Accepted

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

tot = 0
for i in ai:
    cnt = 0
    while (i %2 == 0):
        cnt += 1
        i = i//2
    tot += cnt

print(tot)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
an=map(int,input().split())
cnt = 0
for n in an:
  while True:
    if (n&0b1)==0:
      cnt = cnt+1
      n = n//2
    else:
      break
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
count = 0
for i in range(N):
    while a[i] % 2 == 0:
        while a[i] % 65536 == 0:
            count += 16
            a[i] /= 65536
        else:
            if a[i] % 256 == 0:
                count += 8
                a[i] /= 256
            elif a[i] % 16 == 0:
                count += 4
                a[i] /= 16
            elif a[i] % 4 == 0:
                count += 2
                a[i] /= 4
            elif a[i] % 2 == 0:
                count += 1
                a[i] /= 2
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
k = 0
while k < N:
  if A[k] % 2 == 0:
    ans += 1
    A[k] = A[k]//2
  else:
    k += 1
print(ans)

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

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

    #変数
    count = 0

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

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

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

    ans = 0

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

    print(ans)

main()

Submission status: Accepted

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

cnt_sum = 0
for i in range(N):
    tmp = A[i]
    cnt = 0
    while True:
        if tmp % (2**(cnt + 1)) == 0:
            cnt += 1
            pass
        else:
            break
    cnt_sum += cnt
print(cnt_sum)

Submission status: Accepted

Solution code:
_ = input()
a = [int(i) for i in input().split()]
cnts = []
for i in a:
    cnt = 0
    while i % 2 == 0:
        i /= 2
        cnt += 1
    cnts.append(cnt)
print(sum(cnts))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

cnt = 0
for i in range(N):
    tmp = aN[i]
    while True:
        if tmp % 2 == 0:
            cnt += 1
            tmp //= 2
        else:
            break
print(cnt)

Submission status: Accepted

Solution code:
# your code goes here
N = int(input())
l = list(map(int,input().split()))
k = 0
for i in range(N):
	while l[i] % 2 == 0:
		l[i] = l[i] /2
		k = k + 1
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

while(any(i % 2 == 0 for i in a)):
    total += sum(i % 2 == 0 for i in a)
    a = [i // 2 for i in a if i % 2 == 0]

print(total)

Submission status: Accepted

Solution code:
N = int(raw_input())
a = [int(t) for t in raw_input().split()]

def how_manys_2(a):
  count = 0
  while a % 2 == 0:
    a = a // 2
    count += 1
  return count

b = [how_manys_2(t) for t in a]
print(sum(b))

Submission status: Accepted

Solution code:
N = int(input())
num = list(input().split(" "))
j = 0
for i in range(len(num)):
  s = int(num[i])
  while True:
    if s/2 == int(s/2):
      s = s/2
      j += 1
    else:
      break
print(j)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce

def count_two(n):
	two_count = 0
	while n != 0 and n % 2 == 0:
		two_count += 1
		n //= 2
	return two_count

n = int(input())
a = map(int, input().split())
a_two_count_sum = sum([count_two(ai) for ai in a])
print(a_two_count_sum)

Submission status: Accepted

Solution code:
N = int(input())
a_li = list(map(int,input().split()))
         
cnt = 0
for i in a_li:
    while i % 2 == 0:
        cnt += 1
        i //= 2
        if i % 2 != 0:
            break
        
print(cnt)

Submission status: Accepted

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

cnt = 0
for i in a_li:
    while i % 2 == 0:
        cnt += 1
        i //= 2
        if i % 2 != 0:
            break

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

n = a=int(input()) #つかわない
li = list(map(int,input().split()))

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

print(ans)

Submission status: Accepted

Solution code:
def div2time(n):
    if n % 2 == 1:
        return 0
    return 1 + div2time(n // 2)

if __name__ == "__main__":
    n = int(input())
    array = [int(s) for s in input().split()]
    print(sum(div2time(n) for n in array))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
input(); print(sum(list(map(lambda *x:(lambda f:f(f, *x))(lambda f,a: f(f, a//2)+1 if a % 2 == 0 else 0), 
list(map(int, input().split()))))))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n =int(input())
a = [int(i) for i in input().split()]
count = 0
for num in a:
    while(num % 2 == 0):
        num /= 2
        count += 1

print(count)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int, input().split()))
def two_devide(n):
    ans=0
    while True:
        if n%2: return ans
        else:
            n/=2
            ans+=1
sans=0
for a in A:
    sans+=two_devide(a)
print(sans)

Submission status: Accepted

Solution code:
#coding:utf-8

def is_even(n):
    if n%2 == 0:
        return True
    else:
        return False


N = int(input())
A = list(map(int,input().split()))
 
c = 0
for i in range(N):
    if is_even(A[i]):
        tmp = A[i]

        while is_even(tmp):
            c += 1
            tmp = tmp / 2
            
            if is_even(tmp) == False:
                break

    else:
        continue
    
print(c)

Submission status: Accepted

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

from operator import mul
from functools import reduce

even_list = list(filter(lambda x:x%2==0, a))

if len(even_list) == 0:
    print(0)
else:

    count = 0

    for m in even_list:
    
        while True:
            m = m / 2
            count += 1
    
            if m % 2 == 1:
                break

    print(count)

Submission status: Accepted

Solution code:
n = input()
ar = input().split()
sum=0
for i in range(len(ar)):
   ar[i]= int(ar[i])
   while ar[i]%2==0:
      ar[i]/=2
      sum+=1



print(sum)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest


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

    # See:
    # https://beta.atcoder.jp/contests/abc100/submissions/2675457
    for ai in a:
        while ai % 2 == 0:
            ai //= 2
            count += 1

    print(count)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def soin_to(n):
    N = n
    i = 0
    while(N%2 == 0):
        i += 1
        N /= 2
    return i

N = int(input())
nums = list(map(int, input().split()))
count = 0
for i in range(N):
    count += soin_to(nums[i])

print(count)

Submission status: Accepted

Solution code:

def main():
    n = int(input().strip())
    a = [int(i.strip()) for i in input().split(' ')]

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

    print(ans)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
nums=input().split()
nums=[int(x) for x in nums]
times=0
for i in range(N):
    while nums[i]%2==0:
        nums[i]=nums[i]/2
        times+=1
print(times)

Submission status: Accepted

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

def half(num, count):
    count += 1
    if num % 2 == 0:
        count = half(num//2, count)
    return count

for num in a:
    if num % 2 == 0:
        count += half(num//2, 0)

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

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
a=[x for x in map(int,input().split(' '))]

def f(num):
  n=1
  r=0
  while 2**n <= num:
    if num%2**n == 0:
      r=n
    n+=1
  return r


s=0
for i in range(N):
  if a[i]%2==0:
    s+=f(a[i])

print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split() if int(x) % 2 == 0]
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 = [int(i) for i in input().split()]

b = [n for n in a if n%2 == 0]

cnt = 0
for n in b:
    while n % 2 != 1:
        n = n/2
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
count = 0
i = 0
while (True):
	if (a[i] % 2 == 0):
		a[i] /= 2
		count += 1
		continue
	i += 1
	if(i >= len(a)):
		break

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

c = 0
for a in aa:
    sa = bin(a)
    for i in range(len(sa) - 1, -1, -1):
        if sa[i] == '0':
            c += 1
        else:
            break

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
a_tmp = input().split()
a = [[] for i in range(n)]
for i in range(n):
    a[i] = int(a_tmp[i])
a2 = [[] for i in range(n)]
for i in range(n):
    tmp = a[i]
    coun = 0
    while 1:
        if tmp % 2 == 0:
            tmp = tmp/2
            coun += 1
        else:
            break
    a2[i] = coun

print(sum(a2))

Submission status: Accepted

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

count = 0

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

print(count)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solution(a):
    cnt = 0
    for x in a:
        while (x & 1) == 0:
            x >>= 1
            cnt += 1
    return cnt

def main():
    n = int(raw_input().strip())
    a = [int(i) for i in raw_input().strip().split()]
    print solution(a)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def div2(n):
	i = 0
	while True:
		if n % 2 == 1:
   			return i
		else:
			i += 1
			n /= 2
n = input()
ns = map(int, input().split())
print(sum([ div2(n) for n in ns ]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
A = list(map(bin, map(int, input().split())))
ans = 0
for i in A:
  j = -1
  while True:
    if i[j] == "0":
      ans += 1
      j -= 1
    else:
      break
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:
def two(m):
    count = 0
    while m % 2 == 0:
        count += 1
        m /= 2
    return count

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

ans = 0

for x in l:
    ans += two(x)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A_list = list(map(int, input().split()))
total_cnt = 0
cnt_list = []

for i in range(N):
    cnt_list.append(0)

    while (A_list[i] % 2 == 0):
        A_list[i] /= 2
        cnt_list[i] += 1

    total_cnt += cnt_list[i]

print(total_cnt)

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=input()
N = [int(i) for i in input().split(" ")]
num = []
for i in N:
    count = 0
    temp = i
    while(1):
        if temp%2 == 0:
            temp = temp/2
            count += 1
        else:
            break
    num.append(count)

print(sum(num))

Submission status: Accepted

Solution code:
import math

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

answer = 0
for a in A:
    tmp = a
    while True:
        if tmp % 2 == 1:
            break
        answer += 1
        tmp = math.floor(tmp / 2)

print(str(answer))

Submission status: Accepted

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

Submission status: Accepted

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

flags = [0] * N
limit = 0
for i, num in enumerate(Arr):

    if num  % 2 == 0:
        cnt = 1
        while True:
            num = num // 2
            if not num < 1 and not num % 2 == 0:
                break
            cnt += 1
        flags[i] = cnt

print(sum(flags))

Submission status: Accepted

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

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

print(twos)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
List = list(int(i) for i in input().split())
count = 0

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

for i in List:
    count += cal(i)

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
num = int(raw_input())
li = list(map(int,raw_input().split()))
count = 0
while True:
    li = list(filter(lambda x:x%2 ==0,li))
    count += len(li)
    if len(li) == 0:
        break
    li = list(map(lambda x: x/2,li))
print count

Submission status: Accepted

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

result = 0 
for a_itm in a:
    while(not(a_itm%2)):
        a_itm //= 2
        result+=1

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:

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

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

print(b)

Submission status: Accepted

Solution code:
import math
n = input()
a = list(map(int, input().split()))
ans = 0
for i in a:
    ans = ans + (len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Submission status: Accepted

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

print(sum(count_list))

Submission status: Accepted

Solution code:
N = int(input())

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

c = 0

for i in range(N):
    a = LIST[i]

    while a % 2 == 0:
        a = int(a /2)
        c += 1

print(c)

Submission status: Accepted

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

i = 0
for a in a_list:
    while True:
        if a != 0 and a % 2 == 0:
            a = a / 2
            i += 1
        else:
            break
print(i)

Submission status: Accepted

Solution code:
_ = input()
As = map(int, input().split())

cnt = 0
for a in As:
    while a > 0 and a % 2 == 0:
        a //= 2
        cnt += 1

print(cnt)

Submission status: Accepted

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

def divcount(a):
    from itertools import count
    for i in count():
        if a % 2 != 0:
            return i
        a /= 2

print(sum(divcount(a) for a in As))

Submission status: Accepted

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

Submission status: Accepted

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

def two_factor(n) :
    cnt = 0

    while n % 2 == 0:
        n /= 2
        cnt += 1

    return cnt 
    
fact_cnt = 0
for a in alist :
    fact_cnt += two_factor(a)
    
print(fact_cnt)

Submission status: Accepted

Solution code:
_ = input()
print(sum(map(lambda n: len(bin(n)) - len(bin(n).rstrip("0")), list(map(int, input().split())))))

Submission status: Accepted

Solution code:
_ = input()
print(sum(list(map(lambda n: len(bin(n)) - len(bin(n).rstrip("0")), list(map(int, input().split()))))))

Submission status: Accepted

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

print(sum)