import math

ans = 0
m = 0
n = int(input())
a = []
for i in range(n):
    x = int(input())
    if x > m:
        m = x
    a.append(x)

l = [True for i in range(m+1)]
for i in range(2, int(math.sqrt(m))+2):
    if not l[i]:
        continue
    for j in range(i*2, m+1, i):
        l[j] = False

for i in range(n):
    if l[a[i]]:
        ans += 1

print(ans)