import sys

input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(max(1000, 10**9))

write = lambda x: sys.stdout.write(x+"\n")





n = int(eval(input()))

from collections import Counter

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

c = Counter(a)

s = set()

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

    if v>=2:

        s.add(k)

        

a.sort()

ok = set()

p = set(list(range(1, 10**6+1)))

ck = list(c.keys())

ck.sort()

for num in ck:

    if num in p:

        ok.add(num)

    i = 2

    while num*i<=10**6:

        if num*i in p:

            p.remove(num*i)

        i += 1

tmp = ok

tmp = set(tmp) - s

print((len(tmp)))
n = int(eval(input()))

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

from collections import Counter

c = Counter(a)

vals = [True]*(max(a)+1)

ans = 0

m = max(a)+1

for i in range(1, m):

    if i not in c:

        continue

    if c[i]>=2:

        vals[i] = False

    for j in range(2*i, m, i):

        vals[j] = False

ans = 0

for i in range(1, max(a)+1):

  if vals[i] and i in c:

    ans += 1



print(ans)
import sys

input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x + "\n")
n = int(eval(input()))
from collections import Counter

a = list(map(int, input().split()))
c = Counter(a)
s = set()
for k, v in list(c.items()):
    if v >= 2:
        s.add(k)
a.sort()
ok = set()
p = set(list(range(1, 10**6 + 1)))
ck = list(c.keys())
ck.sort()
for num in ck:
    if num in p:
        ok.add(num)
    i = 2
    while num * i <= 10**6:
        if num * i in p:
            p.remove(num * i)
        i += 1
tmp = ok
tmp = set(tmp) - s
print((len(tmp)))

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

c = Counter(a)
vals = [True] * (max(a) + 1)
ans = 0
m = max(a) + 1
for i in range(1, m):
    if i not in c:
        continue
    if c[i] >= 2:
        vals[i] = False
    for j in range(2 * i, m, i):
        vals[j] = False
ans = 0
for i in range(1, max(a) + 1):
    if vals[i] and i in c:
        ans += 1
print(ans)

-import sys - -input = lambda: sys.stdin.readline().rstrip() -sys.setrecursionlimit(max(1000, 10**9)) -write = lambda x: sys.stdout.write(x + "\n") +a = list(map(int, input().split())) -a = list(map(int, input().split())) -s = set() -for k, v in list(c.items()): -    if v >= 2: -        s.add(k) -a.sort() -ok = set() -p = set(list(range(1, 10**6 + 1))) -ck = list(c.keys()) -ck.sort() -for num in ck: -    if num in p: -        ok.add(num) -    i = 2 -    while num * i <= 10**6: -        if num * i in p: -            p.remove(num * i) -        i += 1 -tmp = ok -tmp = set(tmp) - s -print((len(tmp))) +vals = [True] * (max(a) + 1) +ans = 0 +m = max(a) + 1 +for i in range(1, m): +    if i not in c: +        continue +    if c[i] >= 2: +        vals[i] = False +    for j in range(2 * i, m, i): +        vals[j] = False +ans = 0 +for i in range(1, max(a) + 1): +    if vals[i] and i in c: +        ans += 1 +print(ans)