n = int(input())
A = list(map(int, input().split()))
from collections import Counter
C = Counter(A)
X = [0] * (10 ** 6 + 1)
A = list(set(A))
A.sort()
ans = 0
for a in A:
    if X[a] == 0 and C[a] == 1:
        ans += 1
    X[a] += 1
    j = 2 * a
    while j <= 10 ** 6:
        X[j] += 1
        j += a
print(ans)

0365510ba3efc406176fb1aa1d61ec5b96492af4
<mask token>

<mask token>
A.sort()
<mask token>
for a in A:
    if X[a] == 0 and C[a] == 1:
        ans += 1
    X[a] += 1
    j = 2 * a
    while j <= 10 ** 6:
        X[j] += 1
        j += a
print(ans)

n = int(input())
A = list(map(int, input().split()))
<mask token>
C = Counter(A)
X = [0] * (10 ** 6 + 1)
A = list(set(A))
A.sort()
ans = 0
for a in A:
    if X[a] == 0 and C[a] == 1:
        ans += 1
    X[a] += 1
    j = 2 * a
    while j <= 10 ** 6:
        X[j] += 1
        j += a
print(ans)

n = int(input())
A = list(map(int, input().split()))
from collections import Counter
C = Counter(A)
X = [0] * (10 ** 6 + 1)
A = list(set(A))
A.sort()
ans = 0
for a in A:
    if X[a] == 0 and C[a] == 1:
        ans += 1
    X[a] += 1
    j = 2 * a
    while j <= 10 ** 6:
        X[j] += 1
        j += a
print(ans)
