input()
a = map(int, input().split())
count = 0
for n in a:
    if n == 6:
        count += 3
    elif n == 5:
        count += 2
    elif n % 3 == 2 or n % 2 == 0:
        count += 1
print(count)

e65446fd61793bdc212a44549c0c58b064a65cef
<mask token>

input()
<mask token>
for n in a:
    if n == 6:
        count += 3
    elif n == 5:
        count += 2
    elif n % 3 == 2 or n % 2 == 0:
        count += 1
print(count)

input()
a = map(int, input().split())
count = 0
for n in a:
    if n == 6:
        count += 3
    elif n == 5:
        count += 2
    elif n % 3 == 2 or n % 2 == 0:
        count += 1
print(count)
