from collections import Counter

n = int(eval(input()))

a = sorted([int(x) for x in input().split()])

freq = Counter(a)

A = max(a)

good = [True]*(A+1)

ans = 0

for x in freq:

	for k in range(2*x,A+1,x):

		good[k] = False

	if good[x] and freq[x]==1:

		ans += 1

print(ans)
N = int(eval(input()))

lineup = sorted([int(x) for x in input().split()])

duplicate={}

for i in lineup:

    if i in duplicate:

        duplicate[i]+=1

    else:

        duplicate[i]=1

b=max(lineup)+1

sieve=[1]*(b)

counter=0

for i in range(N):

    if sieve[lineup[i]]:

        if duplicate[lineup[i]]==1:

            counter+=1

        for j in range(lineup[i],b,lineup[i]):

            sieve[j]=0

        

print(counter)
from collections import Counter

n = int(eval(input()))
a = sorted([int(x) for x in input().split()])
freq = Counter(a)
A = max(a)
good = [True] * (A + 1)
ans = 0
for x in freq:
    for k in range(2 * x, A + 1, x):
        good[k] = False
    if good[x] and freq[x] == 1:
        ans += 1
print(ans)

N = int(eval(input()))
lineup = sorted([int(x) for x in input().split()])
duplicate = {}
for i in lineup:
    if i in duplicate:
        duplicate[i] += 1
    else:
        duplicate[i] = 1
b = max(lineup) + 1
sieve = [1] * (b)
counter = 0
for i in range(N):
    if sieve[lineup[i]]:
        if duplicate[lineup[i]] == 1:
            counter += 1
        for j in range(lineup[i], b, lineup[i]):
            sieve[j] = 0
print(counter)

-from collections import Counter - -n = int(eval(input())) -a = sorted([int(x) for x in input().split()]) -freq = Counter(a) -A = max(a) -good = [True] * (A + 1) -ans = 0 -for x in freq: -    for k in range(2 * x, A + 1, x): -        good[k] = False -    if good[x] and freq[x] == 1: -        ans += 1 -print(ans) +N = int(eval(input())) +lineup = sorted([int(x) for x in input().split()]) +duplicate = {} +for i in lineup: +    if i in duplicate: +        duplicate[i] += 1 +    else: +        duplicate[i] = 1 +b = max(lineup) + 1 +sieve = [1] * (b) +counter = 0 +for i in range(N): +    if sieve[lineup[i]]: +        if duplicate[lineup[i]] == 1: +            counter += 1 +        for j in range(lineup[i], b, lineup[i]): +            sieve[j] = 0 +print(counter)