n = int(eval(input()))

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



N = 10 ** 6 + 1



# 一度しか現れないものを抽出する

cnt = [0] * (N + 1)

for a in A:

    cnt[a] += 1



once = []

for a in A:

    if cnt[a] == 1:

        once.append(a)



# 倍数を排除

bl = [True] * (N + 1)

A = list(set(A))

for elem in A:

    for m in range(elem * 2, N + 1, elem):

        bl[m] = False



res = 0

for elem in once:

    if bl[elem]:

        res += 1

print(res)

n = int(eval(input()))

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

from collections import Counter

c = Counter(A)



MAX = 10 ** 6 + 1000

dp = [True] * MAX



for k, v in list(c.items()):

    if dp[k] == False: continue

    if v > 1: dp[k] = False

    for x in range(k + k, MAX, k):

        dp[x] = False



res = 0

for x in range(n):

    if dp[A[x]]: res += 1

print(res)
n = int(eval(input()))
A = list(map(int, input().split()))
N = 10**6 + 1
# 一度しか現れないものを抽出する
cnt = [0] * (N + 1)
for a in A:
    cnt[a] += 1
once = []
for a in A:
    if cnt[a] == 1:
        once.append(a)
# 倍数を排除
bl = [True] * (N + 1)
A = list(set(A))
for elem in A:
    for m in range(elem * 2, N + 1, elem):
        bl[m] = False
res = 0
for elem in once:
    if bl[elem]:
        res += 1
print(res)

n = int(eval(input()))
A = sorted(list(map(int, input().split())))
from collections import Counter

c = Counter(A)
MAX = 10**6 + 1000
dp = [True] * MAX
for k, v in list(c.items()):
    if dp[k] == False:
        continue
    if v > 1:
        dp[k] = False
    for x in range(k + k, MAX, k):
        dp[x] = False
res = 0
for x in range(n):
    if dp[A[x]]:
        res += 1
print(res)

-A = list(map(int, input().split())) -N = 10**6 + 1 -# 一度しか現れないものを抽出する -cnt = [0] * (N + 1) -for a in A: -    cnt[a] += 1 -once = [] -for a in A: -    if cnt[a] == 1: -        once.append(a) -# 倍数を排除 -bl = [True] * (N + 1) -A = list(set(A)) -for elem in A: -    for m in range(elem * 2, N + 1, elem): -        bl[m] = False +A = sorted(list(map(int, input().split()))) +from collections import Counter + +c = Counter(A) +MAX = 10**6 + 1000 +dp = [True] * MAX +for k, v in list(c.items()): +    if dp[k] == False: +        continue +    if v > 1: +        dp[k] = False +    for x in range(k + k, MAX, k): +        dp[x] = False -for elem in once: -    if bl[elem]: +for x in range(n): +    if dp[A[x]]: