import math

n = int(input())
x = []
for i in range(n):
    x.append(int(input()))
s = 0
for i in range(n):
    j = 2
    flag = 1
    while(j > math.sqrt(x[i])):
        if x[i] % j == 0:
            flag = 0
            break
        j += 1
    if flag == 1:
        s += 1
print(s)
