from collections import Counter

n = int(eval(input()))

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

mx = max(a)

flag = [True]*(mx+1)

c = Counter(a)

a.sort()

ans = 0

for i in range(n):

    if flag[a[i]]:

        if c[a[i]] == 1: ans += 1

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

print(ans)
from collections import Counter

n = int(eval(input()))

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

mx = max(a)

flag = [True]*(mx+1)

c = Counter(a)

a.sort()

ans = 0

for i in range(n):

    if flag[a[i]]:

        if c[a[i]] == 1: ans += 1

        for j in range(a[i],mx+1,a[i]): flag[j] = False

print(ans)
from collections import Counter

n = int(eval(input()))
a = [int(i) for i in input().split()]
mx = max(a)
flag = [True] * (mx + 1)
c = Counter(a)
a.sort()
ans = 0
for i in range(n):
    if flag[a[i]]:
        if c[a[i]] == 1:
            ans += 1
        for j in range(2 * a[i], mx + 1, a[i]):
            flag[j] = False
print(ans)

from collections import Counter

n = int(eval(input()))
a = [int(i) for i in input().split()]
mx = max(a)
flag = [True] * (mx + 1)
c = Counter(a)
a.sort()
ans = 0
for i in range(n):
    if flag[a[i]]:
        if c[a[i]] == 1:
            ans += 1
        for j in range(a[i], mx + 1, a[i]):
            flag[j] = False
print(ans)

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