import sys



n=int(eval(input()))

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

a.sort()

max_val=max(a)

dp=[True for i in range(max_val)]

done=[0 for i in range(max_val)]

cnt=0

ans=0



for i in a:



  if 1<=done[i-1]:

    done[i-1]+=1

    continue



  done[i-1]+=1

  cnt=1

  while(i*cnt<=max_val):

    cnt+=1

    if cnt*i<=max_val:

      done[cnt*i-1]+=1



for i in a:

  if done[i-1]==1:

      ans+=1



print(ans)
import sys



n=int(eval(input()))

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

a.sort()

max_val=max(a)



done=[0 for i in range(max_val)]

cnt=0

ans=0



for i in a:



  if 1<=done[i-1]:

    done[i-1]+=1

    continue



  done[i-1]+=1

  cnt=1

  while(i*cnt<=max_val):

    cnt+=1

    if cnt*i<=max_val:

      done[cnt*i-1]+=1



for i in a:

  if done[i-1]==1:

      ans+=1



print(ans)
import sys

n = int(eval(input()))
a = [int(x) for x in input().rstrip().split()]
a.sort()
max_val = max(a)
dp = [True for i in range(max_val)]
done = [0 for i in range(max_val)]
cnt = 0
ans = 0
for i in a:
    if 1 <= done[i - 1]:
        done[i - 1] += 1
        continue
    done[i - 1] += 1
    cnt = 1
    while i * cnt <= max_val:
        cnt += 1
        if cnt * i <= max_val:
            done[cnt * i - 1] += 1
for i in a:
    if done[i - 1] == 1:
        ans += 1
print(ans)

import sys

n = int(eval(input()))
a = [int(x) for x in input().rstrip().split()]
a.sort()
max_val = max(a)
done = [0 for i in range(max_val)]
cnt = 0
ans = 0
for i in a:
    if 1 <= done[i - 1]:
        done[i - 1] += 1
        continue
    done[i - 1] += 1
    cnt = 1
    while i * cnt <= max_val:
        cnt += 1
        if cnt * i <= max_val:
            done[cnt * i - 1] += 1
for i in a:
    if done[i - 1] == 1:
        ans += 1
print(ans)

-dp = [True for i in range(max_val)]