import math

cnt = 0

N = int(input())

for n in range(N):

    i = int(input())

    if i == 2\

    or i == 3\

    or i == 5\

    or i == 7:

        cnt += 1

    elif i % 2 == 0:

        continue

    else:

        j = 3

        prime = 1

        while j >= 3 and j <= int(math.sqrt(i)):

            if i % j == 0:

                prime = 0

                break

                

            j += 2

        if prime == 1:

            cnt += 1



print(cnt)

import math

n = int(input())

cnt = 0

for i in range(n):

    x = int(input())

    if x == 2:

        cnt += 1

    elif x <= 1\

    or x % 2 == 0:

        continue

    else:

        j = 3

        prime = "yes"

        while j <= math.sqrt(x):

            if x % j == 0:

                prime = "no"

                break

            else:

                j += 2

        if prime == "yes":

            cnt += 1

print(cnt)

import math

cnt = 0
N = int(input())
for n in range(N):
    i = int(input())
    if i == 2 or i == 3 or i == 5 or i == 7:
        cnt += 1
    elif i % 2 == 0:
        continue
    else:
        j = 3
        prime = 1
        while j >= 3 and j <= int(math.sqrt(i)):
            if i % j == 0:
                prime = 0
                break
            j += 2
        if prime == 1:
            cnt += 1
print(cnt)

import math

n = int(input())
cnt = 0
for i in range(n):
    x = int(input())
    if x == 2:
        cnt += 1
    elif x <= 1 or x % 2 == 0:
        continue
    else:
        j = 3
        prime = "yes"
        while j <= math.sqrt(x):
            if x % j == 0:
                prime = "no"
                break
            else:
                j += 2
        if prime == "yes":
            cnt += 1
print(cnt)

+n = int(input()) -N = int(input()) -for n in range(N): -    i = int(input()) -    if i == 2 or i == 3 or i == 5 or i == 7: +for i in range(n): +    x = int(input()) +    if x == 2: -    elif i % 2 == 0: +    elif x <= 1 or x % 2 == 0: -        prime = 1 -        while j >= 3 and j <= int(math.sqrt(i)): -            if i % j == 0: -                prime = 0 +        prime = "yes" +        while j <= math.sqrt(x): +            if x % j == 0: +                prime = "no" -            j += 2 -        if prime == 1: +            else: +                j += 2 +        if prime == "yes":