n, *a = list(map(int, open(0).read().split()))           

a.sort()                                           

s = set()                                          

checked = set()                                    

dup = set()                                        

count = 0                                          

for x in a:                                        

    if x in s:                                     

        if x in checked:                           

            dup.add(x)                             

        continue                                   

    count += 1                                     

    checked.add(x)                                 

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

        s.add(x * i)                               

                                                   

print((count - len(dup)))                            
n, *a = list(map(int, open(0).read().split()))

a.sort()

am = a[-1] + 1

dp = [True] * am

ans = 0

dup = set()

for x in a:

    d = dp[x]

    if d:

        ans += 1

        for i in range(x, am, x):

            dp[i] = False

        dp[x] = None

    elif d == None:

        dup.add(x)



print((ans - len(dup)))
n, *a = list(map(int, open(0).read().split()))
a.sort()
s = set()
checked = set()
dup = set()
count = 0
for x in a:
    if x in s:
        if x in checked:
            dup.add(x)
        continue
    count += 1
    checked.add(x)
    for i in range(1, 10**6 // x + 1):
        s.add(x * i)
print((count - len(dup)))

n, *a = list(map(int, open(0).read().split()))
a.sort()
am = a[-1] + 1
dp = [True] * am
ans = 0
dup = set()
for x in a:
    d = dp[x]
    if d:
        ans += 1
        for i in range(x, am, x):
            dp[i] = False
        dp[x] = None
    elif d == None:
        dup.add(x)
print((ans - len(dup)))

-s = set() -checked = set() +am = a[-1] + 1 +dp = [True] * am +ans = 0 -count = 0 -    if x in s: -        if x in checked: -            dup.add(x) -        continue -    count += 1 -    checked.add(x) -    for i in range(1, 10**6 // x + 1): -        s.add(x * i) -print((count - len(dup))) +    d = dp[x] +    if d: +        ans += 1 +        for i in range(x, am, x): +            dp[i] = False +        dp[x] = None +    elif d == None: +        dup.add(x) +print((ans - len(dup)))