

N = int(eval(input()))

X = list(map(int, input().split()))



MAX = 10 ** 6 + 1

prime = [True] * MAX

counted = set()

for v in X:

    if v in counted:

        prime[v] = False

        continue

    for j in range(2 * v, MAX, v):

        prime[j] = False

    counted.add(v)



ans = 0

for v in X:

    ans += int(prime[v])

print(ans)



from collections import Counter



N = int(eval(input()))

X = list(map(int, input().split()))





lim = 10 ** 6 + 10

ok = [True] * (lim + 1)

ans = 0

ctr = Counter(X)

for n in sorted(X):

    if ok[n]:

        if ctr[n] == 1:

            ans += 1

        for j in range(n, lim + 1, n):

            ok[j] = False



print(ans)

N = int(eval(input()))
X = list(map(int, input().split()))
MAX = 10**6 + 1
prime = [True] * MAX
counted = set()
for v in X:
    if v in counted:
        prime[v] = False
        continue
    for j in range(2 * v, MAX, v):
        prime[j] = False
    counted.add(v)
ans = 0
for v in X:
    ans += int(prime[v])
print(ans)

from collections import Counter

N = int(eval(input()))
X = list(map(int, input().split()))
lim = 10**6 + 10
ok = [True] * (lim + 1)
ans = 0
ctr = Counter(X)
for n in sorted(X):
    if ok[n]:
        if ctr[n] == 1:
            ans += 1
        for j in range(n, lim + 1, n):
            ok[j] = False
print(ans)

+from collections import Counter + -MAX = 10**6 + 1 -prime = [True] * MAX -counted = set() -for v in X: -    if v in counted: -        prime[v] = False -        continue -    for j in range(2 * v, MAX, v): -        prime[j] = False -    counted.add(v) +lim = 10**6 + 10 +ok = [True] * (lim + 1) -for v in X: -    ans += int(prime[v]) +ctr = Counter(X) +for n in sorted(X): +    if ok[n]: +        if ctr[n] == 1: +            ans += 1 +        for j in range(n, lim + 1, n): +            ok[j] = False