from collections import defaultdict

import sys

N=int(eval(input()))

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



adic=defaultdict(int)

for a in alist:

  adic[a]+=1



noset=set()

aset=set()

max_a=0

for a,v in list(adic.items()):

  aset.add(a)

  max_a=max(max_a,a)

  if v>=2:

    noset.add(a)

  

if not aset:

  print((0))

  sys.exit(0)

  

tlist=[False]*(max_a+1)

for a in aset:

  tlist[a]=True

#print(tlist)



for i in range(1,len(tlist)):

  if not tlist[i]:

    continue

  else:

    for j in range(2*i,len(tlist),i):

      tlist[j]=False

      

#print(tlist)

answer=0

for i in range(len(tlist)):

  if tlist[i] and not i in noset:

    answer+=1

    

print(answer)
N=int(eval(input()))

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

max_a=max(alist)



exclude_set=set()

tlist=[False]*(max_a+1)

for a in alist:

  if tlist[a]:

    exclude_set.add(a)

  else:

    tlist[a]=True

#print(tlist)



for i in range(1,max_a//2+1):

  if not tlist[i]:

    continue

  else:

    for j in range(2*i,len(tlist),i):

      tlist[j]=False

      

#print(tlist)

answer=0

for i in range(len(tlist)):

  if tlist[i] and not i in exclude_set:

    answer+=1

    

print(answer)
from collections import defaultdict
import sys

N = int(eval(input()))
alist = list(map(int, input().split()))
adic = defaultdict(int)
for a in alist:
    adic[a] += 1
noset = set()
aset = set()
max_a = 0
for a, v in list(adic.items()):
    aset.add(a)
    max_a = max(max_a, a)
    if v >= 2:
        noset.add(a)
if not aset:
    print((0))
    sys.exit(0)
tlist = [False] * (max_a + 1)
for a in aset:
    tlist[a] = True
# print(tlist)
for i in range(1, len(tlist)):
    if not tlist[i]:
        continue
    else:
        for j in range(2 * i, len(tlist), i):
            tlist[j] = False
# print(tlist)
answer = 0
for i in range(len(tlist)):
    if tlist[i] and not i in noset:
        answer += 1
print(answer)

N = int(eval(input()))
alist = list(map(int, input().split()))
max_a = max(alist)
exclude_set = set()
tlist = [False] * (max_a + 1)
for a in alist:
    if tlist[a]:
        exclude_set.add(a)
    else:
        tlist[a] = True
# print(tlist)
for i in range(1, max_a // 2 + 1):
    if not tlist[i]:
        continue
    else:
        for j in range(2 * i, len(tlist), i):
            tlist[j] = False
# print(tlist)
answer = 0
for i in range(len(tlist)):
    if tlist[i] and not i in exclude_set:
        answer += 1
print(answer)

-from collections import defaultdict -import sys - -adic = defaultdict(int) +max_a = max(alist) +exclude_set = set() +tlist = [False] * (max_a + 1) -    adic[a] += 1 -noset = set() -aset = set() -max_a = 0 -for a, v in list(adic.items()): -    aset.add(a) -    max_a = max(max_a, a) -    if v >= 2: -        noset.add(a) -if not aset: -    print((0)) -    sys.exit(0) -tlist = [False] * (max_a + 1) -for a in aset: -    tlist[a] = True +    if tlist[a]: +        exclude_set.add(a) +    else: +        tlist[a] = True -for i in range(1, len(tlist)): +for i in range(1, max_a // 2 + 1): -    if tlist[i] and not i in noset: +    if tlist[i] and not i in exclude_set: