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:
def count2(a):
    cnt = 0
    while 1:
        if a % 2 == 0:
            a = a / 2
            cnt += 1
        else:
            return cnt

N = int(input())
A = list(map(int, input().strip().split(' ')))
print(sum([count2(a) for a in A]))

Submission status: Accepted

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


if __name__ == '__main__':
    _ = input()
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = [int(x) for x in input().split()]
ite = 0
count = 0
while (ite < N):
    if a[ite] % 2 == 0:
        count += 1
        a[ite] = a[ite] // 2
    else:
        ite += 1
print(count)

Submission status: Accepted

Solution code:
def divide(a):
  s = 0
  while True:
    if a % 2 :
      return s
    else:
      a = a // 2
      s += 1
n = int(input())
print(sum([divide(int(a)) for a in input().split()]))

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

Submission status: Accepted

Solution code:
N = int(input())
As = list(map(int, input().split()))
"""
3
5 2 4
2^xについて調べる
"""

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

Submission status: Accepted

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

ans = 0
while True:
    end_flg = True
    for i, item in enumerate(l):
        if item % 2 ==0:
            l[i] = item // 2
            end_flg = False
            ans += 1
    if end_flg:
        break
print(ans)

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:
        ans += 1
        a = a // 2

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
Ans=0
for i in A:
  if i%2==1:
    continue
  else:
    C=0
    n=i
    while n%2==0:
      C=C+1
      n=n//2
    Ans=Ans+C
print(Ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
arr = list(map(int, input().split()))
ctr = 0

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

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

cnt = 0
t = 0

while True:
    for i in range(t,n):
        if li[i] % 2 == 0:
            li[i] //= 2
            t = i
            cnt += 1
            break
    else:
        break

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/07/01
# AtCoder Beginner Contest 100 - C

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

ans = 0

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

# Output
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
A = map(int, input().split())
ans = 0
for a in A:
  while 1:
    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()))

count = 0

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def divide2(x):
    a = 0
    while x%2 == 0:
        x //= 2
        a += 1
    return a
N=int(input())
A = [int(i) for i in input().split()]
print(sum([divide2(a) for a in A]))

Submission status: Accepted

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

count = 0
for item in a_lis:
    while item % 2 == 0:
        count += 1
        item = item // 2
print(count)

Submission status: Accepted

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

N = int(input())
L = [int(v) for v in input().split()]

ans = 0

for v in L:
    c = 0
    while v % (2 ** (c + 1)) == 0:
        c += 1
    ans += c

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c = input()

m = map(int, raw_input().split())
conte = 0


for i in m:
	
	while(i%2 == 0):
		conte += 1
		i /= 2


print conte

Submission status: Accepted

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


def solve(N: int, a: "List[int]"):
    ans = 0
    f = True

    while(f):
        d2 = 0
        b3 = 0
        for i in range(N):
            if(a[i]%2 == 0):
                a[i] = int(a[i]/2)
                d2 += 1
            else:
                b3 += 1
            
        if(d2 != 0):
            f = True
            ans += d2
        else:
            f = False

    print(ans)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

cnt=0
i=1

while i<n+1:
	if x[i-1]%2==0:
		x[i-1]=x[i-1]/2
		cnt+=1
		i+=-1
	i+=1

print(cnt)

Submission status: Accepted

Solution code:
# 偶数のこころが生えた
n = int(input())


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


ans = sum(list(map(lambda x: f(int(x)), input().split())))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

b = 1
for i in range(N):
    b *= a[i]

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

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int,input().split()))
def bai2(a):
	i=0
	while(1):
		if a%2==0:
			a=a//2
			i+=1
		else:
			break
	return i
print(sum([bai2(p) for p in a]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

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

ans = 0

for i in a:

    while i % 2 == 0:

        i = i // 2
        ans += 1

print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = [int(i) for i in input().split()]
a = []
count = 0
for i in range(n):
    if s[i]%2 == 0:
        a.append(s[i])
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:
n=int(input())
a=list(map(int,input().split()))

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

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int, input().split()))
r = 0
for a in A:
 c=0
 while a&(1<<c)==0:
  c+=1
 r+=c
print(r)

Submission status: Accepted

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

# print(N, A)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def divby2(n):
    i = 2
    l = 0
    while n % i == 0:
        n /= i
        l += 1
    return l


# input
n = int(input())
a = list(map(int, input().split()))
o = 0
# calc
for i in range(n):
    o += divby2(a[i])
# output
print(o)

Submission status: Accepted

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


def div2(n: int):
    cnt = 0
    while True:
        if n % 2 == 0:
            n = n//2
            cnt += 1
        else:
            break
    return cnt


B = list(map(div2, A))
print(sum(B))

Submission status: Accepted

Solution code:
N = int(input())
para = [i for i in map(int,input().split())]
"""
全ての与えられた数の２で割り切れる回数の合計を出力すれば良い？
"""
ans = 0
for i in para :
    while True :
        k = 1
        if i % 2 == 0 and i > 0:
            i = i // 2 
            ans += 1
        else : break 
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

def resolve():
	n=int(input())
	a=list(map(int,input().split()))
	t=sum([ninobeki(i) for i in a])
	print(t)
resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
for i in xrange(n):
    curr = a[i]
    while True:
        if curr % 2 == 0:
            curr /= 2
            count += 1
        else:
            break

print count

Submission status: Accepted

Solution code:
# ABC100C - *3 or /2
n = int(input())
lst = [i for i in list(map(int, input().rstrip().split())) if i % 2 == 0]
if lst == []:
    print(0)
else:
    ans = 0
    for i in lst:
        cnt = 0
        while i % 2 == 0:
            i //= 2
            cnt += 1
        ans += cnt
    print(ans)

Submission status: Accepted

Solution code:
# ABC100C - *3 or /2
n = int(input())
lst = [i for i in list(map(int, input().rstrip().split())) if i % 2 == 0]
ans = 0
for i in lst:
    cnt = 0
    while i % 2 == 0:
        i //= 2
        cnt += 1
    ans += cnt
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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


print(ans)

Submission status: Accepted

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

def count_div(i):
    if i % 2 == 1:
        return 0
    else:
        return count_div(i // 2) + 1

total = 0
for i in a:
    total += count_div(i)

print(total)

Submission status: Accepted

Solution code:
def log(n):
    cnt = 0
    while 1:
        if n%2:
            break
        else:
            n //=2
            cnt += 1
    return cnt


n = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x:log(x), a))

print(sum(a))

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 = [int(a) for a in input().split()]

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in 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:
def calc(numbers):
    count = 0

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

    return count

if __name__ == "__main__":
    _ = input()
    numbers = list(map(int, input().split()))

    print(calc(numbers))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
for a in A:
    while a % 2 != 1:
        ans += 1
        a /= 2
print(ans)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
A= list(map(int,input().split()))
i = 0
two = []
for a in A:
    if a%2 == 0:
        two.append(a/2)
        i += 1

while len(two) > 0:
    for j in range(len(two)-1,-1,-1):
        if two[j]%2 == 0:
            two[j] /= 2
            i += 1
        else:
            two.pop(j)
print(i)

Submission status: Accepted

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

ans = 0

for a_i in a:
    temp = str(bin(a_i))
    num_2 = len(temp) - temp.rfind('1')-1
    ans += num_2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
nums = list(map(int, input().split()))
iters = 0
count = 0

while len(nums) != 0:
    size = len(nums)
    nums = list(map(lambda x: x//2, list(filter(lambda x:x%2 == 0, nums))))
    count += (size - len(nums))*iters
    iters += 1
    
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	N = int(input())
	A = list(map(int, input().split(" ")))
	
	ans = 0
	gu = []
	
	for i in A:
		if i % 2 == 0:
			ans += 1
			gu.append(int(i / 2))
			
	while True:
		if len(gu) == 0:
			break
			
		tmp = []
		for i in gu:
			if i % 2 == 0:
				ans += 1
				tmp.append(int(i / 2))
		gu = tmp
	
	print(ans)
	
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


N = int(input())
A = list(map(int, input().split()))
L = [f(a) for a in A]
print(sum(L))

Submission status: Accepted

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

res = 0
for a in ag:
    while True:
        if a & 1 == 0:
            a >>= 1
            res += 1
        else:
            break

print(res)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
a_=[]
cnt=0
while(1):
     while(a):
          a__=a.pop()
          if a__%2==0:
               a_.append(a__//2)
               cnt+=1
     if not a_:
          break
     a=a_.copy()
     a_=[]
print(cnt)

Submission status: Accepted

Solution code:
def twos(t):
    d = 0
    while t % 2 == 0:
        t //= 2
        d += 1
    return d

n = int(input())
A = list(map(int, input().split()))
ans = 0

for i in A:
    ans += twos(i)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
even_number = [i for i in a if i % 2 == 0]

answer = 0
while len([i for i in even_number if i % 2 == 0]) > 0:
  even_number = [i / 2 for i in even_number if i % 2 == 0]
  answer += len(even_number)

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
even_number = [i for i in a if i % 2 == 0]

answer = 0
while len([i for i in even_number if i % 2 == 0]) > 0:
  even_number = [i / 2 for i in even_number if i % 2 == 0]
  answer += len(even_number)

print(answer)

Submission status: Accepted

Solution code:
def two(t):
    d=0
    while t%2==0:
        t//=2
        d+=1
    return d
n=int(input())
A=[int(i) for i in input().split()]
ans=0
for i in A:
    ans+=two(i)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
B=[]
C=0
for i in range (N):
    j=0
    while A[i]%2 != 1:
        A[i]=A[i]/2
        j=j+1
    B.append(j)
C=sum(B)
print(C)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = np.array(input().split(),dtype=np.int32)

def ord(n):
  cnt = 0
  while not n&1:
    n >>= 1
    cnt += 1
  return cnt

np_ord = np.frompyfunc(ord,1,1)
answer = np_ord(A).sum()
print(answer)

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)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(raw_input())
A = map(int, raw_input().split())
sum = 0
for i in range(0, N):
	sum += pow2count(A[i])
print sum

Submission status: Accepted

Solution code:
n = int(input())
num = [ int(v) for v in input().split() ]
def pow_2(m):
	t = 0
	while m % 2 == 0:
		m //= 2
		t += 1
	return t


num = [ pow_2(i) for i in num ]
print(sum(num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def saiki(n,s):
  if n%2==1:
    return s
  else:
    s=s+1
    return(saiki(n/2,s))

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


print(sum([saiki(int(item),0) for item in a]))

Submission status: Accepted

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


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

def solve(N:int, A: "List[int]"):
    print(sum([ f(n) for n in A ]))



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  a=LI()

  c=0
  for x in a:
    y=x
    while True:
      if y%2!=0:
        break
      else:
        y//=2
        c+=1

  print(c)

main()
# print(main())

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
N, *a = map(int, open(0).read().split())
cnt = 0
while a:
    a = [x // 2 for x in a if x % 2 == 0]
    cnt += len(a)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def div_two_time(num):
    count = 0
    while num %2 ==0:
        count +=1
        if num %2 == 0:
            num = num /2
        else:
            break
    return count

import numpy as np 
n = int(input())
seq = list(map(int, input().split()))
count = [div_two_time(seq[i]) for i in range(n)]
print(sum(count))

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
def answer(x):
    ret = 0
    while x % 2 == 0:
        ret += 1; x //= 2
    return ret
n = int(input())
ara = list(map(int, input().split()))[:n]
cnt = 0
for i in ara:
    cnt += answer(i)
print(cnt)

Submission status: Accepted

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

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