N = int(eval(input()))

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

a_Max = A[-1]

B = [0]*a_Max



for a in A:

    if B[a-1] == 0:

        B[a-1] = 1

        for j in range(2,a_Max+1):

            if a*j > a_Max:

                break

            B[a*j-1] = 2

    elif B[a-1] == 1:

        B[a-1] = 2

            

ans = 0

for b in B:

    if b == 1:

        ans += 1



print(ans)



N = int(eval(input()))

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

a_Max = A[-1]

B = [0]*a_Max

ans =0

for a in A:

    if B[a-1] == 0:

        B[a-1] = 1

        ans += 1

        for j in range(a*2-1,a_Max,a):

            B[j] = 2

    elif B[a-1] == 1:

        B[a-1] = 2

        ans -= 1

print(ans)

N = int(eval(input()))
A = sorted((list(map(int, input().split()))))
a_Max = A[-1]
B = [0] * a_Max
for a in A:
    if B[a - 1] == 0:
        B[a - 1] = 1
        for j in range(2, a_Max + 1):
            if a * j > a_Max:
                break
            B[a * j - 1] = 2
    elif B[a - 1] == 1:
        B[a - 1] = 2
ans = 0
for b in B:
    if b == 1:
        ans += 1
print(ans)

N = int(eval(input()))
A = sorted((list(map(int, input().split()))))
a_Max = A[-1]
B = [0] * a_Max
ans = 0
for a in A:
    if B[a - 1] == 0:
        B[a - 1] = 1
        ans += 1
        for j in range(a * 2 - 1, a_Max, a):
            B[j] = 2
    elif B[a - 1] == 1:
        B[a - 1] = 2
        ans -= 1
print(ans)

+ans = 0 -        for j in range(2, a_Max + 1): -            if a * j > a_Max: -                break -            B[a * j - 1] = 2 +        ans += 1 +        for j in range(a * 2 - 1, a_Max, a): +            B[j] = 2 -ans = 0 -for b in B: -    if b == 1: -        ans += 1 +        ans -= 1