n=int(eval(input()))

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

a=sorted(a)

b=list(set(a))

m=len(b)



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

for i in b:

    if p[i]==0:

        j=2

        while i*j<=10**6:

            p[i*j]=1

            j+=1

a.append(-1)

a.insert(0,-1)

ans=0

for i in range(1,n+1):

    if a[i]!=a[i+1] and a[i]!=a[i-1] and p[a[i]]==0:

        ans+=1

print(ans)

n=int(eval(input()))

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



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

for i in a:

    x[i]+=1





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

    if x[i]>=1:

        j=2

        while i*j<=10**6:

            x[i*j]=0

            j+=1

print((x.count(1)))

n = int(eval(input()))
a = list(map(int, input().split()))
a = sorted(a)
b = list(set(a))
m = len(b)
p = [0] * (10**6 + 1)
for i in b:
    if p[i] == 0:
        j = 2
        while i * j <= 10**6:
            p[i * j] = 1
            j += 1
a.append(-1)
a.insert(0, -1)
ans = 0
for i in range(1, n + 1):
    if a[i] != a[i + 1] and a[i] != a[i - 1] and p[a[i]] == 0:
        ans += 1
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
x = [0] * (10**6 + 1)
for i in a:
    x[i] += 1
for i in range(10**6 + 1):
    if x[i] >= 1:
        j = 2
        while i * j <= 10**6:
            x[i * j] = 0
            j += 1
print((x.count(1)))

-a = sorted(a) -b = list(set(a)) -m = len(b) -p = [0] * (10**6 + 1) -for i in b: -    if p[i] == 0: +x = [0] * (10**6 + 1) +for i in a: +    x[i] += 1 +for i in range(10**6 + 1): +    if x[i] >= 1: -            p[i * j] = 1 +            x[i * j] = 0 -a.append(-1) -a.insert(0, -1) -ans = 0 -for i in range(1, n + 1): -    if a[i] != a[i + 1] and a[i] != a[i - 1] and p[a[i]] == 0: -        ans += 1 -print(ans) +print((x.count(1)))