_,*a = list(map(int, open(0).read().split()))

a.sort()

m = -~a[-1]

c = [0]*m

for i in a:

    c[i] += 1

    if c[i] > 1:

        continue

    for j in range(i * 2, m, i):

        c[j] = 2

print((sum(c[i]==1for i in a)))
#!/usr/bin/env python3

_, *a = list(map(int, open(0).read().split()))

a.sort()

p = [0] * a[-1]

for i in a:

    for j in range(1, a[-1] // i + 1):

        p[j * i - 1] += j

print((sum(i == 1 for i in p)))

_, *a = list(map(int, open(0).read().split()))
a.sort()
m = -~a[-1]
c = [0] * m
for i in a:
    c[i] += 1
    if c[i] > 1:
        continue
    for j in range(i * 2, m, i):
        c[j] = 2
print((sum(c[i] == 1 for i in a)))

#!/usr/bin/env python3
_, *a = list(map(int, open(0).read().split()))
a.sort()
p = [0] * a[-1]
for i in a:
    for j in range(1, a[-1] // i + 1):
        p[j * i - 1] += j
print((sum(i == 1 for i in p)))

+#!/usr/bin/env python3 -m = -~a[-1] -c = [0] * m +p = [0] * a[-1] -    c[i] += 1 -    if c[i] > 1: -        continue -    for j in range(i * 2, m, i): -        c[j] = 2 -print((sum(c[i] == 1 for i in a))) +    for j in range(1, a[-1] // i + 1): +        p[j * i - 1] += j +print((sum(i == 1 for i in p)))