N = 1000001

a = [0]* N

_, s = open(0)

for x in s.split():

  a[int(x)] += 1

for i in range(1, N):

  for j in range(i + i, N, i):

    if a[i]:

      a[j] = 0

print((a.count(1)))

N = 1000001

a = [0]* N

_, s = open(0)

for x in s.split():

  a[int(x)] += 1

for i in range(1, N):

  if a[i]:

    for j in range(i + i, N, i):

      a[j] = 0

print((a.count(1)))

N = 1000001
a = [0] * N
_, s = open(0)
for x in s.split():
    a[int(x)] += 1
for i in range(1, N):
    for j in range(i + i, N, i):
        if a[i]:
            a[j] = 0
print((a.count(1)))

N = 1000001
a = [0] * N
_, s = open(0)
for x in s.split():
    a[int(x)] += 1
for i in range(1, N):
    if a[i]:
        for j in range(i + i, N, i):
            a[j] = 0
print((a.count(1)))

-    for j in range(i + i, N, i): -        if a[i]: +    if a[i]: +        for j in range(i + i, N, i):