import math

n = int(raw_input())
num = list()
count = 0
max = 0

for i in range(n):
    num.append(int(raw_input()))

for i in range(n):
    root_num = math.sqrt(num[i])
    for j in range(2, int(root_num) + 1):
        if num[i] % j == 0:
            count = count + 1
            break

print n - count import math math n = int(raw_input()) n int(raw_input()) int raw_input() raw_input num = list() num list() list count = 0 count 0 max = 0 max 0 for i in range(n):
    num.append(int(raw_input())) i range(n) range n num.append(int(raw_input())) num.append num append int(raw_input()) int raw_input() raw_input for i in range(n):
    root_num = math.sqrt(num[i])
    for j in range(2, int(root_num) + 1):
        if num[i] % j == 0:
            count = count + 1
            break i range(n) range n root_num = math.sqrt(num[i]) root_num math.sqrt(num[i]) math.sqrt math sqrt num[i] num i for j in range(2, int(root_num) + 1):
        if num[i] % j == 0:
            count = count + 1
            break j range(2, int(root_num) + 1) range 2 int(root_num) + 1 int(root_num) int root_num 1 if num[i] % j == 0:
            count = count + 1
            break num[i] % j == 0 num[i] % j num[i] num i j 0 count = count + 1 count count + 1 count 1 break print n - count n count root_num = math.sqrt(num[i]) math.sqrt(num[i]) root_num n = int(raw_input()) int(raw_input()) n num = list() list() num max = 0 0 max count = 0 0 count count = count + 1 count + 1 count
import math

n = int(raw_input())
num = list()
count = 0
max = 0

for i in range(n):
    num.append(int(raw_input()))

for i in range(n):
    root_num = math.sqrt(num[i])
    for j in range(2, int(root_num) + 1):
        if num[i] % j == 0:
            count = count + 1
            break

print n - count