from sys import stdin



n = int(eval(input()))



xs = [int(eval(input())) for _ in range(n)]



ans = 0

for x in xs:

    flg = True

    for y in range(2, int(x**0.5+1)):

        if x % y == 0:

            flg = False

            break

    if flg:

        ans += 1



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



ans = 0

for x in (int(eval(input())) for _ in range(n)):

    flg = True

    for y in range(2, int(x**0.5+1)):

        if x % y == 0:

            flg = False

            break

    if flg:

        ans += 1



print(ans)
from sys import stdin

n = int(eval(input()))
xs = [int(eval(input())) for _ in range(n)]
ans = 0
for x in xs:
    flg = True
    for y in range(2, int(x**0.5 + 1)):
        if x % y == 0:
            flg = False
            break
    if flg:
        ans += 1
print(ans)

n = int(eval(input()))
ans = 0
for x in (int(eval(input())) for _ in range(n)):
    flg = True
    for y in range(2, int(x**0.5 + 1)):
        if x % y == 0:
            flg = False
            break
    if flg:
        ans += 1
print(ans)

-from sys import stdin - -xs = [int(eval(input())) for _ in range(n)] -for x in xs: +for x in (int(eval(input())) for _ in range(n)):