n = int(eval(input()))

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

A.sort()



ac = A.count(1)

if ac == 1:

    print((1))

    exit()

if ac >= 2:

    print((0))

    exit()



num = [0]*1000005

for a in A:

    num[a] += 1



b = [False]*1000005

seen = [False]*1000005

cnt = 0

A = list(set(A))

A.sort()

for a in A:

    if seen[a]:

        continue



    seen[a] = True

    if b[a] == False:

        cnt += 1

        if num[a] > 1:

            cnt -= 1



    for i in range(a, 1000005, a):

        b[i] = True

print(cnt)

n = int(eval(input()))

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



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

for a in A:

    num[a] += 1



bai = [False]*(10**6+1)

cnt = 0

A = list(set(A))

A.sort()

for a in A:

    if bai[a]:

        continue



    if num[a] == 1:

        cnt += 1



    for i in range(a, 10**6+1, a):

        bai[i] = True

print(cnt)
n = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ac = A.count(1)
if ac == 1:
    print((1))
    exit()
if ac >= 2:
    print((0))
    exit()
num = [0] * 1000005
for a in A:
    num[a] += 1
b = [False] * 1000005
seen = [False] * 1000005
cnt = 0
A = list(set(A))
A.sort()
for a in A:
    if seen[a]:
        continue
    seen[a] = True
    if b[a] == False:
        cnt += 1
        if num[a] > 1:
            cnt -= 1
    for i in range(a, 1000005, a):
        b[i] = True
print(cnt)

n = int(eval(input()))
A = list(map(int, input().split()))
num = [0] * (10**6 + 1)
for a in A:
    num[a] += 1
bai = [False] * (10**6 + 1)
cnt = 0
A = list(set(A))
A.sort()
for a in A:
    if bai[a]:
        continue
    if num[a] == 1:
        cnt += 1
    for i in range(a, 10**6 + 1, a):
        bai[i] = True
print(cnt)

-A.sort() -ac = A.count(1) -if ac == 1: -    print((1)) -    exit() -if ac >= 2: -    print((0)) -    exit() -num = [0] * 1000005 +num = [0] * (10**6 + 1) -b = [False] * 1000005 -seen = [False] * 1000005 +bai = [False] * (10**6 + 1) -    if seen[a]: +    if bai[a]: -    seen[a] = True -    if b[a] == False: +    if num[a] == 1: -        if num[a] > 1: -            cnt -= 1 -    for i in range(a, 1000005, a): -        b[i] = True +    for i in range(a, 10**6 + 1, a): +        bai[i] = True