import bisect as bc



N = int(eval(input()))

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

A.sort()



dp = [True for _ in range(A[-1]+1)]



for i in range(N):

    ai = A[i]

    for j in range(2,A[-1]+1):

        if ai*j > A[-1]:

            break

        dp[ai*j] = False



ans = 0

finish = [True for _ in range(A[-1]+1)]

for i in range(N):

    if dp[A[i]] and finish[A[i]]:

        if bc.bisect_right(A,A[i]) - bc.bisect_left(A,A[i]) == 1:

            ans += 1

            finish[A[i]] = False



print(ans)





import bisect as bc

 

N = int(eval(input()))

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

A.sort()

 

dp = [True for _ in range(A[-1]+1)]

 

for i in range(N):

    ai = A[i]

    for j in range(2,A[-1]+1):

        if ai*j > A[-1]:

            break

        dp[ai*j] = False

 

ans = 0

for i in range(N):

    if dp[A[i]]:

        if bc.bisect_right(A,A[i]) - bc.bisect_left(A,A[i]) == 1:

            ans += 1

 

print(ans)
import bisect as bc

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
dp = [True for _ in range(A[-1] + 1)]
for i in range(N):
    ai = A[i]
    for j in range(2, A[-1] + 1):
        if ai * j > A[-1]:
            break
        dp[ai * j] = False
ans = 0
finish = [True for _ in range(A[-1] + 1)]
for i in range(N):
    if dp[A[i]] and finish[A[i]]:
        if bc.bisect_right(A, A[i]) - bc.bisect_left(A, A[i]) == 1:
            ans += 1
            finish[A[i]] = False
print(ans)

import bisect as bc

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
dp = [True for _ in range(A[-1] + 1)]
for i in range(N):
    ai = A[i]
    for j in range(2, A[-1] + 1):
        if ai * j > A[-1]:
            break
        dp[ai * j] = False
ans = 0
for i in range(N):
    if dp[A[i]]:
        if bc.bisect_right(A, A[i]) - bc.bisect_left(A, A[i]) == 1:
            ans += 1
print(ans)

-finish = [True for _ in range(A[-1] + 1)] -    if dp[A[i]] and finish[A[i]]: +    if dp[A[i]]: -            finish[A[i]] = False