N=int(eval(input()))

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

ls.sort()



#定数倍のやつに＋１する

M=max(ls)

A=[0]*(M+1)

for i in range(len(ls)):

  a=1

  while ls[i]*a<=M:

    b=ls[i]*a

    if A[b]<=1:

      A[b]+=1

    a+=1

    

ans=0     

for i in range(len(ls)):

  if A[ls[i]]==1:

    ans+=1

print(ans)

N=int(eval(input()))

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

ls.sort()



#定数倍のやつに＋１する

M=max(ls)

A=[0]*(M+1)

for i in range(N):

  a=M//ls[i]

  for j in range(1,a+1):

    A[j*ls[i]]+=1

    

ans=0     

for i in range(len(ls)):

  if A[ls[i]]==1:

    ans+=1

print(ans)
N = int(eval(input()))
ls = list(map(int, input().split()))
ls.sort()
# 定数倍のやつに＋１する
M = max(ls)
A = [0] * (M + 1)
for i in range(len(ls)):
    a = 1
    while ls[i] * a <= M:
        b = ls[i] * a
        if A[b] <= 1:
            A[b] += 1
        a += 1
ans = 0
for i in range(len(ls)):
    if A[ls[i]] == 1:
        ans += 1
print(ans)

N = int(eval(input()))
ls = list(map(int, input().split()))
ls.sort()
# 定数倍のやつに＋１する
M = max(ls)
A = [0] * (M + 1)
for i in range(N):
    a = M // ls[i]
    for j in range(1, a + 1):
        A[j * ls[i]] += 1
ans = 0
for i in range(len(ls)):
    if A[ls[i]] == 1:
        ans += 1
print(ans)

-for i in range(len(ls)): -    a = 1 -    while ls[i] * a <= M: -        b = ls[i] * a -        if A[b] <= 1: -            A[b] += 1 -        a += 1 +for i in range(N): +    a = M // ls[i] +    for j in range(1, a + 1): +        A[j * ls[i]] += 1