N = int(eval(input()))

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

res = 0

for a in A:

    while a%2 == 0:

        res += 1

        a //= 2

print(res)
n = int(eval(input()))

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

res = 0

for a in A:

    while a%2 == 0:

        res += 1

        a //= 2

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

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

-N = int(eval(input())) +n = int(eval(input()))