def cnt(n):

  c = 0

  while True:

    n, flag = n >> 1, n & 1

    if flag: break

    c = c + 1

  return c



eval(input())

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

print((sum(cnt(x) for x in xs)))
eval(input())

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

cnt = lambda n: bin(n)[::-1].find('1')

print((sum(cnt(x) for x in xs)))
def cnt(n):
    c = 0
    while True:
        n, flag = n >> 1, n & 1
        if flag:
            break
        c = c + 1
    return c


eval(input())
xs = list(map(int, input().split()))
print((sum(cnt(x) for x in xs)))

eval(input())
xs = list(map(int, input().split()))
cnt = lambda n: bin(n)[::-1].find("1")
print((sum(cnt(x) for x in xs)))

-def cnt(n): -    c = 0 -    while True: -        n, flag = n >> 1, n & 1 -        if flag: -            break -        c = c + 1 -    return c - - +cnt = lambda n: bin(n)[::-1].find("1")