import math
N = int(input())
A = [int(input()) for i in range(N)]
c=0
for i in range(N):
    x=A[i]
    if x < 2: continue
    if x==2 or x==3 or x==5:c+=1
    if x%2==0 or x%3==0 or x%5==0: continue

    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: continue
        prime += step
        step = 6 - step
    c += 1
print(c)