from sys import stdin

n = int(eval(input()))

a = list(map(int, stdin.readline().split()))

a.sort()

amax = max(a)+1

e = [0]*amax

ans = 0



for i in range(n):

    e[a[i]] += 1

    if e[a[i]] == 1:

        for j in range(2*a[i], amax, a[i]):

            e[j] += 2



print((e.count(1)))
from sys import stdin

n = int(eval(input()))

a = list(map(int, stdin.readline().split()))

a.sort()

amax = max(a)+1

e = [True]*amax

Alice = set()

Bob = set()

ans = 0



for i in range(n):

    if e[a[i]] == True:

        Alice.add(a[i])

        for j in range(a[i], amax, a[i]):

            e[j] = False

    else:

        if a[i] in Alice:

            Bob.add(a[i])



print((len(Alice - Bob)))
from sys import stdin

n = int(eval(input()))
a = list(map(int, stdin.readline().split()))
a.sort()
amax = max(a) + 1
e = [0] * amax
ans = 0
for i in range(n):
    e[a[i]] += 1
    if e[a[i]] == 1:
        for j in range(2 * a[i], amax, a[i]):
            e[j] += 2
print((e.count(1)))

from sys import stdin

n = int(eval(input()))
a = list(map(int, stdin.readline().split()))
a.sort()
amax = max(a) + 1
e = [True] * amax
Alice = set()
Bob = set()
ans = 0
for i in range(n):
    if e[a[i]] == True:
        Alice.add(a[i])
        for j in range(a[i], amax, a[i]):
            e[j] = False
    else:
        if a[i] in Alice:
            Bob.add(a[i])
print((len(Alice - Bob)))

-e = [0] * amax +e = [True] * amax +Alice = set() +Bob = set() -    e[a[i]] += 1 -    if e[a[i]] == 1: -        for j in range(2 * a[i], amax, a[i]): -            e[j] += 2 -print((e.count(1))) +    if e[a[i]] == True: +        Alice.add(a[i]) +        for j in range(a[i], amax, a[i]): +            e[j] = False +    else: +        if a[i] in Alice: +            Bob.add(a[i]) +print((len(Alice - Bob)))