from collections import Counter

N = int(eval(input()))

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

C = Counter(A)



A = set(A)

MAX_A = 10 ** 6

X = [0] * (MAX_A + 1)

for a in A:

    for i in range(a, MAX_A + 1, a):

        X[i] += 1



ans = len([a for a in A if (X[a] == 1) and (C[a] == 1)])

print(ans)
from collections import Counter

N = int(eval(input()))

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

C = Counter(A)

A = set(A)

B = [True] * (10 ** 6 + 1)

for a in A:

    for i in range(2 * a,10**6 + 1 ,a):

        B[i] = False

cnt = 0

for a in A:

    if (B[a] == True) and (C[a] == 1):

        cnt += 1

print(cnt)
from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
C = Counter(A)
A = set(A)
MAX_A = 10**6
X = [0] * (MAX_A + 1)
for a in A:
    for i in range(a, MAX_A + 1, a):
        X[i] += 1
ans = len([a for a in A if (X[a] == 1) and (C[a] == 1)])
print(ans)

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
C = Counter(A)
A = set(A)
B = [True] * (10**6 + 1)
for a in A:
    for i in range(2 * a, 10**6 + 1, a):
        B[i] = False
cnt = 0
for a in A:
    if (B[a] == True) and (C[a] == 1):
        cnt += 1
print(cnt)

-MAX_A = 10**6 -X = [0] * (MAX_A + 1) +B = [True] * (10**6 + 1) -    for i in range(a, MAX_A + 1, a): -        X[i] += 1 -ans = len([a for a in A if (X[a] == 1) and (C[a] == 1)]) -print(ans) +    for i in range(2 * a, 10**6 + 1, a): +        B[i] = False +cnt = 0 +for a in A: +    if (B[a] == True) and (C[a] == 1): +        cnt += 1 +print(cnt)