from collections import Counter



N = int(eval(input()))

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



MAX = 10 ** 6 + 10

multiples = [0] * MAX



for a in list(set(A)):

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

        multiples[j] = 1



d = Counter(A)

dup = [k for k, v in list(d.items()) if v > 1]

for i in dup:

    multiples[i] = 1



ans = 0

for i in A:

    if multiples[i] == 0:

        ans += 1

print(ans)

N = int(eval(input()))

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

MAX = 10 ** 6 + 10

cnt = [0] * MAX  # cntが1以上ならその数以下に約数が1個以上存在する(自分も含める)



for a in A:

    if cnt[a] != 0:

        cnt[a] += 1

        continue

    for j in range(a, MAX, a):

        cnt[j] += 1

ans = 0

for a in A:

    if cnt[a] == 1:

        ans += 1

print(ans)

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
MAX = 10**6 + 10
multiples = [0] * MAX
for a in list(set(A)):
    for j in range(a * 2, MAX, a):
        multiples[j] = 1
d = Counter(A)
dup = [k for k, v in list(d.items()) if v > 1]
for i in dup:
    multiples[i] = 1
ans = 0
for i in A:
    if multiples[i] == 0:
        ans += 1
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
MAX = 10**6 + 10
cnt = [0] * MAX  # cntが1以上ならその数以下に約数が1個以上存在する(自分も含める)
for a in A:
    if cnt[a] != 0:
        cnt[a] += 1
        continue
    for j in range(a, MAX, a):
        cnt[j] += 1
ans = 0
for a in A:
    if cnt[a] == 1:
        ans += 1
print(ans)

-from collections import Counter - -multiples = [0] * MAX -for a in list(set(A)): -    for j in range(a * 2, MAX, a): -        multiples[j] = 1 -d = Counter(A) -dup = [k for k, v in list(d.items()) if v > 1] -for i in dup: -    multiples[i] = 1 +cnt = [0] * MAX  # cntが1以上ならその数以下に約数が1個以上存在する(自分も含める) +for a in A: +    if cnt[a] != 0: +        cnt[a] += 1 +        continue +    for j in range(a, MAX, a): +        cnt[j] += 1 -for i in A: -    if multiples[i] == 0: +for a in A: +    if cnt[a] == 1: