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:
input()
def f(a):
  a = int(a)
  r = 0
  while a % 2 == 0:
    a /= 2
    r += 1
  return r
print(sum(map(f, input().split())))

Submission status: Accepted

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

result = 0

for a in aa:
    while a % 2 == 0:
        a //= 2
        result += 1

print(result)

Submission status: Accepted

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

def a2(num):
	t=num
	c=0
	while t %2==0:
		c += 1
		t=t/2
	return c
		


# 整数の入力
a = int(raw_input())

ary= map(int, raw_input().split())
ret=sum([a2(x) for x in ary])
print  ret

Submission status: Accepted

Solution code:
N = int(raw_input())
A = map(int, raw_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())
aas = list(map(int, input().split()))

r = 0
i = 1

while True:
  f = False
  for a in aas:
    if a%2**i == 0:
      r += 1
      f = True
  if not f:
    break
  i += 1
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
def countbin(x):
    cnt = 0
    while x%2 == 0:
        cnt += 1
        x = x // 2
    return cnt
print(sum(map(countbin, a)))

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
for i in range(N):
    A = a[i]
    # while 2 * 2 <= A:
    while A % 2 == 0:
        A /= 2
        counter += 1
        # break
print(int(counter))

Submission status: Accepted

Solution code:
#abc100c

n=int(raw_input())
a=map(int,raw_input().split())
cnt=0
for i in xrange(n):
 while a[i]%2==0:
  cnt+=1
  a[i]/=2
print cnt

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

def digit(i):
    a=0
    while True:
        Flag = int(i%2)
        if Flag==1:
            break;
        i = i/2
        a=a+1
    return(a)

        
Total=0
for i in A:
        add = digit(i)
        Total=Total+add
print(Total)

Submission status: Accepted

Solution code:
import math

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

count=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n, a):
    ans = 0
    for i in range(n):
        while a[i] % 2 == 0:
            a[i] /= 2
            ans += 1
    return ans

assert solve(3, [5,2,4]) == 3
assert solve(4, [631,577,243,199]) == 0
assert solve(10, [2184,2126,1721,1800,1024,2528,3360,1945,1280,1776]) == 39

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

Submission status: Accepted

Solution code:
n = int(input())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return(0)
 else:
  return(f(x//2)+1)
for i in range(n):
 ans += f(lis[i])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    p = 0
    while i%2 == 0:
        i = i/2
        p += 1
    ans += p
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:
input()
def div2(n):
	i=0
	while n%2==0:
		i,n=i+1,n/2
	return i
arr=map(div2,map(int,input().split()))
print(sum(arr))

Submission status: Accepted

Solution code:
#coding : utf-8

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

Submission status: Accepted

Solution code:
n = input()

power_2 = 0

val = map(int, raw_input().split(' '))

for i in val:
	while i % 2 == 0:
		i /= 2
		power_2 += 1

print power_2

Submission status: Accepted

Solution code:


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




N=int(input())
a=spaceinput()

def warisu(x):
    count=0
    for i in range(10**10):
        if x%2!=0:
            break
        x=x/2
        count+=1
    return count


res=0
for sa in a:
    res+=warisu(sa)

print(res)

Submission status: Accepted

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

input() # ignore N
print(sum(map(count, map(int, input().split()))))

Submission status: Accepted

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

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

ans = 0
for i in l:
    tmp = i
    num = 0
    while (tmp % 2 == 0):
        num += 1
        tmp /= 2
    ans += num

print(ans)

Submission status: Accepted

Solution code:
def read():
    return int(input())


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


def readmap():
    return map(int, input().split())


N = read()
A = readlist()

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

print(cnt)

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

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

    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def xx(x: int):
    """
    2で何回割れるのか
    """
    counter = 0
    while True:
        x_, y = divmod(x, 2)
        if y != 0:
            return counter
        x, counter = x_, counter + 1

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

res = 0
for n in ns:
    res += xx(n)
print(res)

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
for i in range(n):
  l[i] = l[i] * 3
c = 0
for i in range(n):
  t = l[i]
  j = 0
  while True:
    if not t % 2 == 0:
      c += j
      break
    else:
      t = t // 2
    j += 1
print(c)

Submission status: Accepted

Solution code:

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
input()
n = [int(i) for i in input().split()]
index = 0
count = 0
while index < len(n):
    if n[index] % 2 == 0:
        n[index] /= 2
        n[index] = int(n[index])
        count += 1
    else:
        index += 1
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
raw_input()
aN = map(lambda x: bin(int(x))[2:], raw_input().split(' '))

count = 0
for a in aN:
    count += len(a)-len(a.strip('0'))

print count

Submission status: Accepted

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

count = 0
for ele in a:
    while(True):
        if ele % 2 == 0:
            ele /= 2
            count += 1
        else:
            break
print(count)

Submission status: Accepted

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

for A in As:
    while A % 2 == 0:
        A = A // 2
        c += 1

print(c)

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(N):
    ans += str(bin(a[i]))[::-1].index('1')
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

N = int(input())
a = [int(i) for i in input().split()]
counter = 0

if any([True if i % 2 == 0 else False for i in a]):
    for i in a:
        while i % 2 == 0:
            i = i/2
            counter += 1
    print(counter)

else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def func(x):
    if(x % 2 != 0):
        return 0
    else:
        return func(x / 2) + 1

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

    ans = 0
    for i in range(n):
        ans += func(a[i])
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
def check(num):
    if num%2:
        return 0
    else:
        return 1

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

if __name__ == "__main__":
    n = int(input())
    a = list(map(process, [ tmp for tmp in list(map(int, input().split())) if check(tmp) ]))
    ans = sum(a)
    print(ans)

Submission status: Accepted

Solution code:
import sys
if __name__ == "__main__":
    N = int(input())
    A = list(input().split(' '))
    cnt = 0
    for ele in A:
        ele = int(ele)
        while ele % 2 == 0:
            cnt += 1
            ele = ele / 2.0
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in arr:
    if i % 2 == 0:
        ans += div(i)
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())
List = input()
import re

Shift = re.split(" ",List)
Ctr = 1
Wlist = []


for Ctr in range(1,N+1):
    Xn = 1
    DW = int(Shift[Ctr-1])
    while True:
        if DW % (2**Xn) != 0:
            break
        else:
            Xn += 1
    Wlist.append(Xn-1)
    Ctr += 1

print(sum(Wlist))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def count_2(n):
    count = 0
    while n % 2 == 0:
        count += 1
        n = n >> 1
    return count

_ = input()
a = map(int, input().split())
print(sum(map(count_2, a)))

Submission status: Accepted

Solution code:
def f(x):
	return 0 if int(x)%2 else f(int(x)//2)+1
n = input()
print(sum(list(map(f,input().split()))))

Submission status: Accepted

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

ct = 0

for i in range(len(a)):
    if a[i] % 2 == 0:
        while True:
            a[i] = a[i] // 2
            ct += 1
            if a[i] % 2 != 0:
                break
print(ct)

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())


s = list(map(int,list(input().rstrip().split())))

count = 0

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

print(count)

Submission status: Accepted

Solution code:
s = [input() for i in range(2)]
a = int(s[0])
b = [int(bi) for bi in s[1].split(' ')]

n = 0
for bi in b:
    while bi % 2 == 0:
        n += 1
        bi = bi / 2
print(n)

Submission status: Accepted

Solution code:
from math import log2


def action(n):
    count = 0
    while n % 2 == 0:
        n //= 2
        count += 1
    else:
        return count

def main():
    _n = int(input())
    nums = [int(x) for x in input().split()]

    print(sum([int(action(e)) for e in nums if e % 2 == 0]))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import log2

N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)


if n_list != []:
    maxnum = max(n_list)
    maxnum = log2(maxnum)
    maxnum = int(maxnum)
    for num2 in n_list:
        for i in range(maxnum):
            if num2 % 2**(i+1) == 0:
                count+=1


print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

sys.stdin.readline()
a = list(map(int, sys.stdin.readline().split()))

a = [x for x in a if x % 2 == 0]

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

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
a=np.array(list(map(int, input().split(' '))))
count=0
i=1
while 2**i<a.max():
    count+=(a%(2**i)==0).sum()
    i+=1
print(count)

Submission status: Accepted

Solution code:
dustshoot = input()

def insu2(n):
    if n == 0:
        return 0

    counter = 0
    flag = 0
    while(flag == 0):
        flag = n % 2
        if flag == 0:
            counter += 1
            n = n / 2
        else:
            break
    return counter

ip = input().split()
usdata = []
c_sum = 0

for i in ip:
    usdata.append(int(i))

for i in usdata:
    add = insu2(i)
    c_sum += add

print(c_sum)

Submission status: Accepted

Solution code:
n = int(input())
line = input()
liststr = line.split()
list = []
 
for i in liststr:
    i = int(i)
    list.append(i)
 
 
cc = 0
for r in list:
    while r%2 == 0:
        r = r / 2
        cc = cc + 1
 
 
print(cc)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())
a = [int(x) for x in raw_input().split()]
s = 0
for ai in a:
  while ai%2 == 0:
    s+=1
    ai/=2
print s

Submission status: Accepted

Solution code:
def run(n, a):
    cnt = 0
    for i in range(n):
        while a[i] % 2 == 0:
            a[i] /= 2
            cnt += 1
    return cnt


def read_line():
    n, = input().split()
    a = input().split()
    n = int(n)
    a = [int(a[i]) for i in range(n)]
    return (n, a)


def main():
    n, a = read_line()
    print(run(n, a))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

m=0

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

Submission status: Accepted

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

n = int(input())
i = input().split(' ')
a = list(map(lambda e:int(e), i))

step = 0
es = list(filter(lambda e:e%2==0, a))
os = list(filter(lambda e:e%2!=0, a))

def power_exponent(z):
    step = 0
    while z%2==0:
        step = step+1
        z = z/2
    return step

if len(es) == 0:
    pass
else:
    for e in es:
        step = step + power_exponent(e)
print(step)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
i=0
b=A
while len(b)>0:
    c=[]
    for number in b:
        if(number%2==0):
            c.append(number/2)
    i+=len(c)
    b=[]
    for number in c:
        if(number%2==0):
            b.append(number/2)
    i+=len(b)
print(i)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
counter = 0
check = [2]
e = 2
while 2**e <= 1000000000:
	check.append(2**e)
	e += 1
for i in range(n):
	if a[i]%2 == 0:
		for k in range(len(check)):
			if a[i]%check[k] == 0:
				counter += 1
			else:
				break
print(counter)

Submission status: Accepted

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

d = deque(A)
c = 0
while(len(d)>0):
    tmp = d.pop()
    if tmp%2==0:
        c+=1
        d.append(tmp//2)
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
println = stdout.write

def cnt(n):
    i = 0
    while 1:
        n, mod = divmod(n, 2)
        if mod:
            break
        i += 1
    return i

def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    ans = 0
    for i in A:
        ans += cnt(i)
    print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

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

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

Submission status: Accepted

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

l = []
s = 1
count = 0

while(len(a) != 0):

# for j in xrange(0,5):
	for i in xrange(0,len(a)):
		if a[i]%2 == 0 and a[i] != 0:
			l.append(a[i] >> 1)

	count += len(l)
	a = []
	a.extend(l)
	l = []

print count

Submission status: Accepted

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

def check(x):
    times=0
    while(x%2==0):
        x=x/2
        times+=1


    return times


for i in range(n):
    ans+=check(lis[i])

print(ans)

Submission status: Accepted

Solution code:
def get_score(x):
    result = 0
    if (x % 2) != 0:
        return 0

    while ((x % 2) == 0) and (x >= 2):
        x = x//2
        result = result + 1

    return result


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

r = 0

for i in a:
    r = r + get_score(i)

print(r)

Submission status: Accepted

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


count = 0
for i in nums:
    w = i
    while not w & 1:
        w = int(w / 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):
    if a[i]%2 != 0:
        continue
    else:
        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()))

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

print(c)

Submission status: Accepted

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

# C_star_by_3_or_div_by_2.py

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

num_division = (-1) * N

for a in A:
    while int(a) == a:
        a = a/2
        num_division += 1

print(num_division)

Submission status: Accepted

Solution code:
def to2(num):
    if num % 2 == 0:
        return int(num / 2)
    else:
        return num

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

cout = 0
for n in a:
    while True:
        ret_n = to2(n)
        if ret_n == n:
            break
        else:
            cout += 1
        n = ret_n

print(cout)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
count = 0
judge = False

#奇数
odd = []
#偶数
even = []

# 奇数と偶数に分ける
for i_a in range(len(a)):
    if(a[i_a] % 2 == 0):
        even.append(a[i_a])
    else:
        odd.append(a[i_a])
# もし偶数がいない場合は操作不可能
if(even == []):
    print(0)
    exit()

# 偶数を一つ取り出し、2で割る。次で割れなくなるなら削除
while True:
    count += 1
    even[0] /= 2
    if(even[0] % 2 != 0):
        even.pop(0)
    if(even == []):
        break
        

print(count)


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             count += 1
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         print(a)
#         exit()


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         exit()
#     else:
#         count += 1

Submission status: Accepted

Solution code:
import sys
tmp = int(input())
a = tmp
b = [int(i) for i in input().split()]
cnt_list = [0] * a
flag_cnt = 0
while flag_cnt < a:
    flag_cnt = 0
    for j in range(a):
        if b[j] % 2 == 0:
            b[j] /= 2
            cnt_list[j] += 1
        else:
            flag_cnt += 1
print(sum(cnt_list))

Submission status: Accepted

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

c = 0 
for a in As: 
    b = a 
    while b % 2 == 0:
        b = b/2 
        c = c + 1 

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
def count(n):
    c = 0
    while True:
        if n % 2 == 1:
            break
        n /= 2
        c += 1
    return c

s = 0
n = int(input())
l = list(map(int, input().split()))
for a in l:
    s += count(a)
print(s)

Submission status: Accepted

Solution code:
#coding : utf8

string_list = [input().split() for i in range(2)]
arrayli = list(map(int,string_list[1]))

count = 0
flag = 0
for i in arrayli:
    for j in range(1,500000001):
        if( (i % pow(2,j)) == 0):
            count +=1
        else:
            break

print(count)

Submission status: Accepted

Solution code:
N = int(input())

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

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


print(count)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
a = input().split()
a = [int(aa) for aa in a]

s = 0
for k in range(N):
    if a[k] % 2 == 0:
        j = 0
        while True:
            j += 1
            a[k] = a[k]/2
            if a[k] % 2 != 0:
                break
        s += j
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(1, 100):
    s = len([x for x in a_list if x % (2**i) == 0])
    if s == 0:
        break
    ans += s

print(ans)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
a = na()
# ans = 0
# while True:
#     dtwo = 0
#     for i in range(n):
#         if a[i] % 2 == 0 and dtwo == 0:
#             a[i]//=2
#             dtwo = 1
#         else:
#             a[i]*=3
#     if dtwo == 0:
#         break
#     ans += 1
# print(ans)
ans = 0
for i in range(n):
    tmp = a[i]
    while True:
        if tmp%2 == 0:
            ans += 1
        else:
            break
        tmp = tmp / 2
print(ans)

Submission status: Accepted

Solution code:
def calc_power(x,y):
    count = 0
    while(x%y==0):
        x=x/y
        count = count + 1
    return count


n  = input()
li = list(map(int,input().split()))
count = 0
for i in li:
    count = count + calc_power(i,2)
print (count)