n = int(eval(input()))

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

M = max(a)

ok = [0]*(M+1)

a.sort()



for i in range(n):

    ok[a[i]] += 1



for i in range(n):

    if ok[a[i]] != 0:

        for g in range(a[i], M+1, a[i]):

            if g != a[i]:

                ok[g] = 0



print((ok.count(1)))
n = int(eval(input()))

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

a.sort()

MAX = a[-1]

l = [0]*(MAX+1)

for i in range(n):

    l[a[i]] += 1



ans = 0

for i in range(n):

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

        ans += 1

    for g in range(a[i], MAX+1, a[i]):

        l[g] = 10



print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
M = max(a)
ok = [0] * (M + 1)
a.sort()
for i in range(n):
    ok[a[i]] += 1
for i in range(n):
    if ok[a[i]] != 0:
        for g in range(a[i], M + 1, a[i]):
            if g != a[i]:
                ok[g] = 0
print((ok.count(1)))

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
MAX = a[-1]
l = [0] * (MAX + 1)
for i in range(n):
    l[a[i]] += 1
ans = 0
for i in range(n):
    if l[a[i]] == 1:
        ans += 1
    for g in range(a[i], MAX + 1, a[i]):
        l[g] = 10
print(ans)

-M = max(a) -ok = [0] * (M + 1) +MAX = a[-1] +l = [0] * (MAX + 1) -    ok[a[i]] += 1 +    l[a[i]] += 1 +ans = 0 -    if ok[a[i]] != 0: -        for g in range(a[i], M + 1, a[i]): -            if g != a[i]: -                ok[g] = 0 -print((ok.count(1))) +    if l[a[i]] == 1: +        ans += 1 +    for g in range(a[i], MAX + 1, a[i]): +        l[g] = 10 +print(ans)