from collections import Counter

n = int(eval(input()))

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

 

M = max(a)

d = [1 for i in range(M+1)]

for v in sorted(a):

    for j in range(2*v, M+1, v):

        d[j] = 0

ans = 0

c = Counter(a)

for i in a:

    if c[i]==1:

      ans += d[i]

print(ans)
from collections import Counter

n=int(eval(input()))

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

ma=max(a)

a.sort()

era=[1]*(ma+1)

#0と1はふるいにかけられている。

cn=Counter(a)



count=0

for i in range(n):

  if era[a[i]]==0:continue

  else:

    era[a[i]]=0

    if cn[a[i]]==1:

      count+=1

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

      era[j]=0

print(count)
from collections import Counter

n = int(eval(input()))
a = [int(v) for v in input().split()]
M = max(a)
d = [1 for i in range(M + 1)]
for v in sorted(a):
    for j in range(2 * v, M + 1, v):
        d[j] = 0
ans = 0
c = Counter(a)
for i in a:
    if c[i] == 1:
        ans += d[i]
print(ans)

from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
ma = max(a)
a.sort()
era = [1] * (ma + 1)
# 0と1はふるいにかけられている。
cn = Counter(a)
count = 0
for i in range(n):
    if era[a[i]] == 0:
        continue
    else:
        era[a[i]] = 0
        if cn[a[i]] == 1:
            count += 1
        for j in range(2 * a[i], ma + 1, a[i]):
            era[j] = 0
print(count)

-a = [int(v) for v in input().split()] -M = max(a) -d = [1 for i in range(M + 1)] -for v in sorted(a): -    for j in range(2 * v, M + 1, v): -        d[j] = 0 -ans = 0 -c = Counter(a) -for i in a: -    if c[i] == 1: -        ans += d[i] -print(ans) +a = list(map(int, input().split())) +ma = max(a) +a.sort() +era = [1] * (ma + 1) +# 0と1はふるいにかけられている。 +cn = Counter(a) +count = 0 +for i in range(n): +    if era[a[i]] == 0: +        continue +    else: +        era[a[i]] = 0 +        if cn[a[i]] == 1: +            count += 1 +        for j in range(2 * a[i], ma + 1, a[i]): +            era[j] = 0 +print(count)