from collections import Counter

N = int(eval(input()))

A = list(map(int, input().split()))

A.sort()

count_of_a = Counter(A)

# すでに出現した倍数の場合はアウト

ans = 0

max_A = max(A)

dp = [True] * (max_A+1)

happpend = set()

for a in A:

    if count_of_a[a] >= 2:

        # 複数出現するとしても，初めての要素の場合は処理を行う

        if a in happpend:

            continue

        x = a*2

        while x <= max_A:

            dp[x] = False

            x += a

        happpend.add(a)

    else:

        if dp[a]:

            ans += 1

        x = a*2

        while x <= max_A:

            dp[x] = False

            x += a

        happpend.add(a)

print(ans)

from collections import Counter

N = int(eval(input()))

A = list(map(int, input().split()))

A.sort()

count_of_a = Counter(A)

# すでに出現した倍数の場合はアウト

ans = 0

max_A = max(A)

dp = [True] * (max_A+1)

happpend = set()

for a in A:

    if count_of_a[a] >= 2:

        # 複数出現するとしても，初めての要素の場合は処理を行う

        if a in happpend:

            continue

        x = a*2

        while x <= max_A:

            dp[x] = False

            x += a

        happpend.add(a)

    else:

        if dp[a]:

            ans += 1

        x = a*2

        while x <= max_A:

            dp[x] = False

            x += a

print(ans)

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
count_of_a = Counter(A)
# すでに出現した倍数の場合はアウト
ans = 0
max_A = max(A)
dp = [True] * (max_A + 1)
happpend = set()
for a in A:
    if count_of_a[a] >= 2:
        # 複数出現するとしても，初めての要素の場合は処理を行う
        if a in happpend:
            continue
        x = a * 2
        while x <= max_A:
            dp[x] = False
            x += a
        happpend.add(a)
    else:
        if dp[a]:
            ans += 1
        x = a * 2
        while x <= max_A:
            dp[x] = False
            x += a
        happpend.add(a)
print(ans)

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
count_of_a = Counter(A)
# すでに出現した倍数の場合はアウト
ans = 0
max_A = max(A)
dp = [True] * (max_A + 1)
happpend = set()
for a in A:
    if count_of_a[a] >= 2:
        # 複数出現するとしても，初めての要素の場合は処理を行う
        if a in happpend:
            continue
        x = a * 2
        while x <= max_A:
            dp[x] = False
            x += a
        happpend.add(a)
    else:
        if dp[a]:
            ans += 1
        x = a * 2
        while x <= max_A:
            dp[x] = False
            x += a
print(ans)

-        happpend.add(a)