N = int(eval(input()))

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



t = [True] * (10 ** 6 + 1)

d = {}

for a in A:

    d.setdefault(a, 0)

    d[a] += 1



A = sorted(set(A))

for a in A:

    if d[a] > 1:

        t[a] = False

    for i in range(a + a, 10 ** 6 + 1, a):

        t[i] = False



result = 0

for a in A:

    if t[a]:

        result += 1

print(result)

N = int(eval(input()))

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



d = {}

for a in A:

    d.setdefault(a, 0)

    d[a] += 1



A = sorted(set(A))

t = [True] * (10 ** 6 + 1)



for a in A:

    for i in range(a + a, 10 ** 6 + 1, a):

        t[i] = False



for a in d:

    if d[a] > 1:

        t[a] = False



result = 0

for a in A:

    if t[a]:

        result += 1

print(result)

N = int(eval(input()))
A = list(map(int, input().split()))
t = [True] * (10**6 + 1)
d = {}
for a in A:
    d.setdefault(a, 0)
    d[a] += 1
A = sorted(set(A))
for a in A:
    if d[a] > 1:
        t[a] = False
    for i in range(a + a, 10**6 + 1, a):
        t[i] = False
result = 0
for a in A:
    if t[a]:
        result += 1
print(result)

N = int(eval(input()))
A = list(map(int, input().split()))
d = {}
for a in A:
    d.setdefault(a, 0)
    d[a] += 1
A = sorted(set(A))
t = [True] * (10**6 + 1)
for a in A:
    for i in range(a + a, 10**6 + 1, a):
        t[i] = False
for a in d:
    if d[a] > 1:
        t[a] = False
result = 0
for a in A:
    if t[a]:
        result += 1
print(result)

-t = [True] * (10**6 + 1) +t = [True] * (10**6 + 1) +    for i in range(a + a, 10**6 + 1, a): +        t[i] = False +for a in d: -    for i in range(a + a, 10**6 + 1, a): -        t[i] = False