import sys

eval(input());c=0

for x in map(int,sys.stdin):

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

print(c)

import sys

eval(input())

print((sum(2 in[x,pow(2,x,x)]for x in map(int,sys.stdin))))

import sys

eval(input())
c = 0
for x in map(int, sys.stdin):
    if 2 in [x, pow(2, x, x)]:
        c += 1
print(c)

import sys

eval(input())
print((sum(2 in [x, pow(2, x, x)] for x in map(int, sys.stdin))))

-c = 0 -for x in map(int, sys.stdin): -    if 2 in [x, pow(2, x, x)]: -        c += 1 -print(c) +print((sum(2 in [x, pow(2, x, x)] for x in map(int, sys.stdin))))