c=0

n=int(eval(input()))

for _ in range(n):

 x=int(eval(input()))

 if x!=2 and x%2==0:c+=1;continue

 for i in range(3,int(x**.5+1),2):

  if x%i==0:c+=1;break

print((n-c))

n=int(eval(input()))

c=0

for _ in range(n):

 x=int(eval(input()))

 if 2 in [x,pow(2,x,x)]:c+=1

print(c)

c = 0
n = int(eval(input()))
for _ in range(n):
    x = int(eval(input()))
    if x != 2 and x % 2 == 0:
        c += 1
        continue
    for i in range(3, int(x**0.5 + 1), 2):
        if x % i == 0:
            c += 1
            break
print((n - c))

n = int(eval(input()))
c = 0
for _ in range(n):
    x = int(eval(input()))
    if 2 in [x, pow(2, x, x)]:
        c += 1
print(c)

+n = int(eval(input())) -n = int(eval(input())) -    if x != 2 and x % 2 == 0: +    if 2 in [x, pow(2, x, x)]: -        continue -    for i in range(3, int(x**0.5 + 1), 2): -        if x % i == 0: -            c += 1 -            break -print((n - c)) +print(c)