n = int(input())
A = [int(input()) for x in range(n)]
A_max = max(A)

p_table = [x for x in range(2,A_max+1)]
p_table
for p in p_table:
    j=2
    while 0 < j*p-2 < len(p_table):
            p_table[j*p-2] = 0
            j += 1
p_table = [x for x in p_table if x != 0]

count = 0
for a in A:
    if a in p_table:
        count += 1

print(count)