import math

n = int(input())

cnt = 0

for i in range(n):

    j = 2

    num = int(input())

    while j <= math.sqrt(num):

        if num % j == 0:

            break

        j+=1

    if j > math.sqrt(num):

        cnt+=1

print(cnt)

import math



n = int(eval(input()))

cnt = 0

for i in range(n):

    num = int(eval(input()))

    flag = 1

    if num == 2:

        flag = 1

    elif num % 2 == 0 or num < 2:

        flag = 0

    else:

        for j in range(3, int(math.sqrt(num))+1, 2):

            if num % j == 0:

                flag = 0

                break

    if flag:

        cnt+=1

print(cnt)

import math

n = int(input())
cnt = 0
for i in range(n):
    j = 2
    num = int(input())
    while j <= math.sqrt(num):
        if num % j == 0:
            break
        j += 1
    if j > math.sqrt(num):
        cnt += 1
print(cnt)

import math

n = int(eval(input()))
cnt = 0
for i in range(n):
    num = int(eval(input()))
    flag = 1
    if num == 2:
        flag = 1
    elif num % 2 == 0 or num < 2:
        flag = 0
    else:
        for j in range(3, int(math.sqrt(num)) + 1, 2):
            if num % j == 0:
                flag = 0
                break
    if flag:
        cnt += 1
print(cnt)

-n = int(input()) +n = int(eval(input())) -    j = 2 -    num = int(input()) -    while j <= math.sqrt(num): -        if num % j == 0: -            break -        j += 1 -    if j > math.sqrt(num): +    num = int(eval(input())) +    flag = 1 +    if num == 2: +        flag = 1 +    elif num % 2 == 0 or num < 2: +        flag = 0 +    else: +        for j in range(3, int(math.sqrt(num)) + 1, 2): +            if num % j == 0: +                flag = 0 +                break +    if flag: