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:
# -*- coding: utf-8 -*-

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    N = int(input())
    a = list(map(int, input().split()))

    return N, a


def get_divisible_count(x: int) -> int:
    """
    2で何回割ることができるかを返す.

    Args:\n
        x (int): 整数

    Returns:\n
        int: 2で割ることができる回数
    """
    divisible_count = 0
    while x % 2 == 0:
        divisible_count += 1
        x /= 2
    return divisible_count


def main(N: int, a: list) -> tuple:
    """
    メイン処理.

    Args:\n
        N (int): 数列の長さ(1 <= N <= 10000)
        a (list): 数列(1 <= a_i <= 1000000000)

    Returns:\n
        tuple: [description]
    """
    ans = 0
    for n in range(N):
        ans += get_divisible_count(a[n])

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N, a = get_input()

    # メイン処理
    main(N, a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())
a = list(map(int, input().split()))

# 求解処理


def get_divisible_count(x: int) -> int:
    divisible_count = 0
    while x % 2 == 0:
        divisible_count += 1
        x /= 2
    return divisible_count


ans = 0
for n in range(N):
    ans += get_divisible_count(a[n])

# 結果出力
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0
for i in range(N):
  if A[i] % 2 == 0:
    ans += two_divisor(A[i])
    
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

C=[0]*n 
for i in range(n):
    cnt=0
    while A[i]%2==0:
        cnt+=1
        A[i]//=2
    C[i]=cnt 
print(sum(C))

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

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

print(ans)

Submission status: Accepted

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


def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    ans = 0

    for a in a_list:
        ans += divide_by_2(a)

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = 0
for i in range(n):
    cnt = 0
    while True:
        if L[i]%2 == 0:
            cnt +=1
            L[i]//=2
        else:
            break
    ans +=cnt
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))

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

print(ans)

Submission status: Accepted

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

if list1 == []:
  print(0)
elif len(list1) == 1:
  print(list1[0])
else:
  print(sum(list1))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

num_of_factor_2 = []

for i in range(len(a_list)):
    a_trial = 0
    while a_list[i] % 2 == 0:
        a_list[i] = a_list[i] / 2
        a_trial += 1
    num_of_factor_2.append(a_trial)
    
print(sum(num_of_factor_2))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

n = int(input())
a = list(map(int,input().split()))
ans = 0
for j in a:
	ans += twos(j)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding=utf-8

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

    C = 0
    for i in range(N):
        if lia[i] % 2 ==0:
            tmp = lia[i]
            while tmp % 2 ==0:
                tmp = tmp / 2
                C += 1

    print(int(C))

Submission status: Accepted

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


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


ans = 0
for i in range(n):
    ans += count_2(a[i], 0)

print(ans)

Submission status: Accepted

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


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


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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(29, 0, -1):
        if a[i] % (2 ** j) == 0:
            ans += j
            break
print(ans)

Submission status: Accepted

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

res = 0
for i in range(N):
  fi_flg = False
  while fi_flg is False:
    if a[i] % 2 == 0:
      a[i] = int(a[i]/2)
      res += 1
    else:
      fi_flg = True
      
print(res)

Submission status: Accepted

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

count = 0
for i in a:
    if i%2 == 0:
        while i%2 == 0:
            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):
    if  A[i]%2 !=0:
        continue
    else:
        N =A[i]
        while N %2==0:
            N=N//2
            count+=1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

    for i in range(n):
        a = a_lst[i]

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

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

    ans = 0

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans=0
for i in a:
  ans=ans+check(i)
  
print(ans)

Submission status: Accepted

Solution code:
'''
Created on 2020/08/17

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  N=int(pin())
  a=list(map(int,pin().split()))
  ans=0
  for i in a:
    if i%2==1:
      continue
    t=i
    while True:
      if t%2==0:
        t=t//2
        ans+=1
      else:
        break
  print(ans)
  return

main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def chk(n):
    global dic
    cnt = 0
    while n%2==0:
        n = n//2
        cnt += 1
    dic.setdefault(cnt,0)
    dic[cnt] += 1
    return cnt

dic = {}
dic.setdefault(0,0)
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    tmp = chk(a[i])
#print(dic)
ans = 0
for item in dic.items():
    ans += item[0]*item[1]
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

total = 0

for l in lists:
  if l % 2 == 0:
    while True:
      if l % 2 == 0:
        l = int(l/2)
        total += 1      
      else:
        break
print(total)

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()
# sys.setrecursionlimit(100000)


def main():
    _ = int(input().strip())
    A = [int(i) for i in input().strip().split()]
    cnt = 0
    for a in A:
        x = a
        while x % 2 == 0:
            x = x // 2
            cnt += 1
    print(cnt)
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def prime_factor_2(n):
  if n % 2 == 0 and n % 4 != 0:
    return 1
  if n % 2 == 1:
    return 0
  
  return 1 + prime_factor_2(int(n/2))

N = int(input())
A = list(map(lambda a: int(a), input().split(" ")))
print(sum([prime_factor_2(a) for a in A]))

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    A = nl()
    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 i in range(N):
  while True :
    if a[i]%2!=0 :
      break
    count+=1
    a[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:
        a[i] //= 2
        ans += 1
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
ans = 0
for v in A:
    while v%2 == 0:
        ans += 1
        v//=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 == 0:
    while i%2 == 0:
      i //= 2
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(k):
    cnt = 0
    while k%2 == 0:
        k //= 2
        cnt += 1
        # print(k)
        # print("-----")
    return cnt

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

for a in A:
    if a%2 == 0:
        ans += f(a)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print (ans)

Submission status: Accepted

Solution code:
def div(k):
    k = int(k)
    i = 0
    while k%2==0:
        k//=2
        i+=1
    return i
n = int(input());print(sum(list(map(div, input().split()))))

Submission status: Accepted

Solution code:
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))


n = ri()
li = rl()
ans = 0
for i in li:
    t = 0
    while i & 1 == 0:
        i //= 2
        t += 1
    ans += t
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

def factorize(n):
    i = 2
    prime_factors = {}
    while i ** 2 <= n:
        exp = 0
        while n % i == 0:
            exp += 1
            n //= i
        if exp:
            prime_factors[i] = exp
        i += 1
    if n != 1:
        prime_factors[n] = 1
    return prime_factors

ans = 0
for v in a:
    prime_factors = factorize(v)
    if 2 in prime_factors:
        ans += prime_factors[2]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ni(num):
  return format(num, 'b')[::-1].find('1')
N=int(input())
L=list(map(int,input().split()))
L=list(map(ni,L))
print(sum(L))

Submission status: Accepted

Solution code:
def d(x,c):
 if x%2!=0: return c
 return d(x/2, c+1)

input()
print(sum(d(i,0) for i in map(int,input().split())))

Submission status: Accepted

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


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

control_count = 0
for i in range(n):
    control_count += divide_2(a[i])
print(control_count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

res = 0

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

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
c=0
n=int(input())
ar=[int(i) for i in input().strip().split(" ")]
for i in range(n):
    t=ar[i]
    while(t%2==0):
        c+=1
        t=(t//2)
print(c)

Submission status: Accepted

Solution code:
import numpy
N = int(input())
a = numpy.array(list(map(int, input().split())))
count = 0

for i in range(N):
    if a[i] % 2 == 0:
        x = a[i]
        while True:
            if x %2 != 0:
                break
            else:
                x = x/2
                count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

for i in a:
  if i%2==0:
    K=True
    while K:
      if i%2!=1:
        i//=2
        count+=1
      else:
        K =False
          
print(count)

Submission status: Accepted

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

x = 0
count = 0

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

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 i in range(N):
  j = 0
  while 1:
    if a[i] % (2 ** (j + 1)) == 0:
      j += 1
    else:
      ans += j
      j = 0
      break
else:
  print(ans)

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

Submission status: Accepted

Solution code:
n,*aa = map(int, open(0).read().split())

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int,input().split()))
ans = sum((a & -a).bit_length() - 1 for a in A)
print(ans)

Submission status: Accepted

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

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

print(sum(map(f,a)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

res = 0
for i in range(n):
    j = al[i]
    while j % 2 ==0:
        res +=1
        j = j//2

print(res)

Submission status: Accepted

Solution code:
def c_time3_or_div2():
    N = int(input())
    A = [int(i) for i in input().split()]
    # a を 2 進数として下位ビットから見たとき，最初に 1 が現れるまでの 0 の個数
    return sum((a & -a).bit_length() - 1 for a in A)

print(c_time3_or_div2())

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 100
# C - *3 or /2
def f(N,c):
    if N%2==0:
        n=N//2
        c+=1
        return f(n,c)
    else:
        return c



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

count=0

for a in A:
    count+= f(a,0)

print(count)