N = int(eval(input()))

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

U = [0]*(10**6+1)

for e in A:

    U[e] += 1

ans = 0

for k in range(1,max(A)+1):

    if U[k] == 1:

        ans += 1

    if U[k] > 0:

        for l in range(2*k,10**6+1,k):

            if U[l] > 0:

                U[l] += 1

print(ans)

N = int(eval(input()))

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

m = max(A)

U = [0]*(m+1)

for e in A:

    U[e] += 1

ans = 0

for k in range(1,m+1):

    if U[k] == 1:

        ans += 1

    if U[k] > 0:

        for l in range(2*k,m+1,k):

            if U[l] > 0:

                U[l] += 1

print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
U = [0] * (10**6 + 1)
for e in A:
    U[e] += 1
ans = 0
for k in range(1, max(A) + 1):
    if U[k] == 1:
        ans += 1
    if U[k] > 0:
        for l in range(2 * k, 10**6 + 1, k):
            if U[l] > 0:
                U[l] += 1
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
m = max(A)
U = [0] * (m + 1)
for e in A:
    U[e] += 1
ans = 0
for k in range(1, m + 1):
    if U[k] == 1:
        ans += 1
    if U[k] > 0:
        for l in range(2 * k, m + 1, k):
            if U[l] > 0:
                U[l] += 1
print(ans)

-U = [0] * (10**6 + 1) +m = max(A) +U = [0] * (m + 1) -for k in range(1, max(A) + 1): +for k in range(1, m + 1): -        for l in range(2 * k, 10**6 + 1, k): +        for l in range(2 * k, m + 1, k):