n = int(eval(input()))

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



max_a = max(a)

flag = [True for i in range(max_a+1)]



dup = set()

for i in range(n):

    if a[i] in dup:

        flag[a[i]] = False

    else:

        dup.add(a[i])

    for j in range(2*a[i], max_a+1, a[i]):

        flag[j] = False



ans = 0

for i in a:

    ans += flag[i]

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

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



max_a = max(a)

flag = [True for i in range(max_a+1)]



dup = set()

for i in range(n):

    if a[i] in dup:

        flag[a[i]] = False

    else:

        dup.add(a[i])

        for j in range(2*a[i], max_a+1, a[i]):

            flag[j] = False



ans = 0

for i in a:

    ans += flag[i]

print(ans)
n = int(eval(input()))
a = [int(i) for i in input().split()]
max_a = max(a)
flag = [True for i in range(max_a + 1)]
dup = set()
for i in range(n):
    if a[i] in dup:
        flag[a[i]] = False
    else:
        dup.add(a[i])
    for j in range(2 * a[i], max_a + 1, a[i]):
        flag[j] = False
ans = 0
for i in a:
    ans += flag[i]
print(ans)

n = int(eval(input()))
a = [int(i) for i in input().split()]
max_a = max(a)
flag = [True for i in range(max_a + 1)]
dup = set()
for i in range(n):
    if a[i] in dup:
        flag[a[i]] = False
    else:
        dup.add(a[i])
        for j in range(2 * a[i], max_a + 1, a[i]):
            flag[j] = False
ans = 0
for i in a:
    ans += flag[i]
print(ans)

-    for j in range(2 * a[i], max_a + 1, a[i]): -        flag[j] = False +        for j in range(2 * a[i], max_a + 1, a[i]): +            flag[j] = False