import sys
import math

#num = [int(i) for i in sys.argv[2:]]
n = input()
num = [int(i) for i in sys.stdin.readlines()]
count = 0

for i in num:
    if i == 1:
        continue
    elif i == 2:
        continue

    square = int(math.ceil(math.sqrt(i)))

    for j in range(2, square):
        if i % j == 0:
            break
    else:
        count += 1

print(count)
