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(N):

  a=M//ls[i]

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

    if A[ls[i]]>=2:

      break

    else:

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

  continue  

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(N):
    a = M // ls[i]
    for j in range(1, a + 1):
        if A[ls[i]] >= 2:
            break
        else:
            A[j * ls[i]] += 1
    continue
ans = 0
for i in range(len(ls)):
    if A[ls[i]] == 1:
        ans += 1
print(ans)

-        A[j * ls[i]] += 1 +        if A[ls[i]] >= 2: +            break +        else: +            A[j * ls[i]] += 1 +    continue