import math

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

    return ret

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 = hurui(m)

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

print(ans)