n = int(eval(input()))

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

maxA = max(A)

# C[a] = A内のaの個数

C = {a: 0 for a in A}

for a in A:

    C[a] += 1

# D[a]=1: Aにaより小さいaの約数が存在する

D = {a: 0 for a in A}

for a in A:

    if C[a] > 0:

        tmp = 2

        while a * tmp <= maxA:

            D[a * tmp] = 1

            tmp += 1

ans = 0

for a in A:

    if C[a] == 1 and D[a] == 0:

        ans += 1

print(ans)

n = int(eval(input()))

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

maxA = max(A)

C = {a: 0 for a in A}

for a in A:

    C[a] += 1

D = {a: 0 for a in A}

for a in A:

    if C[a] > 1:

        D[a] = 1

    for b in range(2 * a, maxA + 1, a):

        D[b] = 1

print((sum([D[a] == 0 for a in A])))

n = int(eval(input()))
(*A,) = list(map(int, input().split()))
maxA = max(A)
# C[a] = A内のaの個数
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in A}
for a in A:
    if C[a] > 0:
        tmp = 2
        while a * tmp <= maxA:
            D[a * tmp] = 1
            tmp += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)

n = int(eval(input()))
(*A,) = list(map(int, input().split()))
maxA = max(A)
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
D = {a: 0 for a in A}
for a in A:
    if C[a] > 1:
        D[a] = 1
    for b in range(2 * a, maxA + 1, a):
        D[b] = 1
print((sum([D[a] == 0 for a in A])))

-# C[a] = A内のaの個数 -# D[a]=1: Aにaより小さいaの約数が存在する -    if C[a] > 0: -        tmp = 2 -        while a * tmp <= maxA: -            D[a * tmp] = 1 -            tmp += 1 -ans = 0 -for a in A: -    if C[a] == 1 and D[a] == 0: -        ans += 1 -print(ans) +    if C[a] > 1: +        D[a] = 1 +    for b in range(2 * a, maxA + 1, a): +        D[b] = 1 +print((sum([D[a] == 0 for a in A])))