CodeEff/ECCO huggingface dataset:
# Original solution
N=int(eval(input()))
A=list(map(int, input().split()))
A=sorted(A)
DI={}
for i in A:
  if i not in DI:
    DI[i]=1
  else:
    DI[i]+=1  
d=0
B=sorted(list(set(A)))
n=len(B)
for i in range(n):
  if DI[B[i]]==1:
    d+=1
    for j in range(0,i):
      if B[i]<B[j]*2:
        break
      if B[i]%B[j]==0:
        d-=1
        break
print(d)

# Optimized solution
N=int(eval(input()))
A=list(map(int, input().split()))
A=sorted(A)
D=[1]*(A[-1]+1)
for i in A:
  if D[i]==1:
    for j in range(A[-1]//i):
      D[i*(j+1)]=0
    D[i]=1
dic={}
for i in A:
  if i not in dic:
    dic[i]=1
  else:
    dic[i]+=1

for i in dic:
  if dic[i]>1:
    D[i]=0
    
ans=0
for i in A:
  if D[i]==1:
    ans+=1
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

ans_list = [[1, 0] for i in range(1000001)]
for i in range(N):
    now = A[i]
    if ans_list[now][1] >= 2:
        continue
    elif ans_list[now][1] == 1:
        ans_list[now][1] = 2
    else:
        ans_list[now][1] = 1
    for j in range(2*now, 1000001, now):
        ans_list[j][0] = 0

count = 0
for i in range(N):
    now = A[i]
    if ans_list[now][0] == 1 and ans_list[now][1] == 1:
        count += 1
        
print(count)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

num = [1 for i in range(1000001)]
ans_list = [0 for i in range(1000001)]
for i in range(N):
    now = A[i]
    if ans_list[now] == 2:
        continue
    elif ans_list[now] == 1:
        ans_list[now] = 2
    else:
        ans_list[now] = 1
    for j in range(2*now, 1000001, now):
        num[j] = 0

count = 0
for i in range(N):
    now = A[i]
    if num[now] == 1 and ans_list[now] == 1:
        count += 1
        
print(count)
# Original solution
#!/usr/bin/env python3
import sys


def II(): return int(sys.stdin.readline())


def MI(): return list(map(int, sys.stdin.readline().split()))


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    A = LI()
    A.sort()
    MAX = 10**6+1
    All = [0 for i in range(MAX)]

    setA = set(A)
    for i in A:
        k = i
        All[k] += 1
        k += i
        if All[i] == 2:
            continue
        while k < MAX and i in setA:
            All[k] += 1
            k += i

    ans = 0
    for i in range(1, MAX):
        if All[i] == 1 and i in setA:
            ans += 1

    print(ans)

    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()


# Optimized solution
#!/usr/bin/env python3
import sys


def II(): return int(sys.stdin.readline())


def MI(): return list(map(int, sys.stdin.readline().split()))


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    A = LI()
    A.sort()
    MAX = A[-1]+1
    All = [0 for i in range(MAX)]

    setA = set(A)
    for i in A:
        k = i
        All[k] += 1
        k += i
        if All[i] == 2:
            continue
        while k < MAX and i in setA:
            All[k] += 1
            k += i

    ans = 0
    for i in range(1, MAX):
        if All[i] == 1 and i in setA:
            ans += 1

    print(ans)

    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()
# Original solution
#!/usr/bin/env python3
import sys


def II(): return int(sys.stdin.readline())


def MI(): return list(map(int, sys.stdin.readline().split()))


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    A = LI()
    A.sort()
    MAX = 10**6+1
    All = [0] * MAX

    setA = set(A)
    for i in A:
        k = i
        All[k] += 1
        k += i
        if All[i] == 2:
            continue
        while k < MAX:
            All[k] += 1
            k += i

    ans = 0
    for i in range(1, MAX):
        if All[i] == 1 and i in setA:
            ans += 1

    print(ans)

    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()


# Optimized solution
#!/usr/bin/env python3
import sys


def II(): return int(sys.stdin.readline())


def MI(): return list(map(int, sys.stdin.readline().split()))


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    A = LI()
    A.sort()
    MAX = 10**6+1
    All = [0] * MAX

    setA = set(A)
    for i in A:
        k = i
        All[k] += 1
        k += i
        if All[i] >= 2:
            continue
        while k < MAX:
            All[k] += 1
            k += i

    ans = 0
    for i in range(1, MAX):
        if All[i] == 1 and i in setA:
            ans += 1

    print(ans)

    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in list(c.items()):
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=[]

while True:
    aa.append(a[0])
    a2=[]
    for i in range(1,len(a)):
        if a[i]%a[0]!=0:
            a2.append(a[i])
#    a=a2.copy()
    if len(a2)==0:
        break

    aa.append(a2[0])
    a=[]
    for i in range(1,len(a2)):
        if a2[i]%a2[0]!=0:
            a.append(a2[i])
#    a=a2.copy()
    if len(a)==0:
        break

aaset=set(aa)
aaset=aaset-dset    
print((len(aaset)))

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in list(c.items()):
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print((len(aa)))
# Original solution
n=int(eval(input()))
arr=list(map(int,input().strip().split()))
arr.append(0)
arr.sort()
arr.append(0)
count=0
s=set()
for i in range(1,n+1):
    if(arr[i]==arr[i-1] or arr[i]==arr[i+1]):
        s.add(arr[i])
    else:
        if(len(s)):
            crr=list(s)
            flag=0
            for j in range(len(s)):
                if(arr[i]%crr[j]==0):
                    flag=1
                    break
            if(flag==0):
                count=count+1
            s.add(arr[i])
        else:
            s.add(arr[i])
            count=count+1
print(count)            
                
            
            
        

            
        
    


# Optimized solution
n=int(eval(input()))
arr=list(map(int,input().strip().split()))
arr.sort()
maxi=arr[-1]
booll=[True]*(maxi+1)
r=0
for i in range(n-1):
    a=arr[i]
    if(booll[a]==True):
        for j in range(a,maxi+1,a):
            booll[j]=False
        if(a<arr[i+1]):
            r=r+1
if(booll[arr[n-1]]==True):
    r=r+1
print(r)
# Original solution
from math import sqrt
from collections import Counter

def is_prime(n):
  if n == 1:
    return False
  for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
      return False
  return True

def make_divisors(n, d):
    lower_divisors , upper_divisors = [], []
    i = 2
    while i*i <= n:
        if n % i == 0:
            if d[i] > 0:
              return True
            if i != n // i and d[n//i] > 0:
                return True
        i += 1
    return False

a=int(eval(input()))
b=[int(x) for x in input().split()]
b=sorted(b)
d=Counter(b)
c=0
if d[1] > 1:
  print((0))
elif d[1] > 0:
  print((1))
else:
  for i in range(0, a):
    if d[b[i]] > 1:
      c+=1
    elif not is_prime(b[i]):
      if make_divisors(b[i], d):
        c+=1
  print((a-c))

# Optimized solution
from collections import Counter

def board(dp, i):
  m = 1
  while i*m <= len(dp)-1:
    dp[i*m]=False
    m+=1

a=int(eval(input()))
b=[int(x) for x in input().split()]
b=sorted(b)
d=Counter(b)
dp=[True]*(b[-1]+1)
c=0
for i in b:
  if dp[i] and d[i] < 2:
    c+=1
  board(dp, i)
print(c)
# Original solution
import collections,sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N = I()
A = sorted(LI())
ans_bool = [0]*(10**6+1)
for a in A:
    num = a
    while num<=10**6:
        ans_bool[num] += 1
        num += a
ans = 0
for a in A:
    if ans_bool[a]==1:
        ans += 1
print(ans)


# Optimized solution
import collections,sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N = I()
A = sorted(LI())
counter_A = collections.Counter(A)
sequence = [0]*(10**6+1)
ans = 0
for k,v in list(counter_A.items()):
    if sequence[k]==1:
        continue
    if v==1:
        ans += 1
    for i in range(k,10**6+1,k):
        sequence[i] = 1
print(ans)
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
prime = [True] * (10 ** 6 + 10)

b = sorted(set(a))

for i in b:
    num = i * 2
    while True:
        if num >= 10 ** 6 + 10:
            break
        prime[num] = False
        num += i

ans = 0
for s in a:
    if prime[s] == True and c[s] == 1:
        ans += 1

print(ans)

# Optimized solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
prime = [True] * (10 ** 6 + 10)

b = sorted(set(a))

for i in b:
    num = i * 2
    while True:
        if num >= 10 ** 6 + 1:
            break
        prime[num] = False
        num += i

ans = 0
for s in a:
    if prime[s] == True and c[s] == 1:
        ans += 1

print(ans)
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
prime = [True] * (10 ** 6 + 10)
 
b = sorted(set(a))
 
for i in b:
    num = i * 2
    while True:
        if num >= 10 ** 6 + 1:
            break
        prime[num] = False
        num += i
 
ans = 0
for s in a:
    if prime[s] == True and c[s] == 1:
        ans += 1
 
print(ans)

# Optimized solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
prime = [True] * (10 ** 6 + 10)
 
b = sorted(set(a))
 
for i in b:
    num = i * 2
    while True:
        if num >= 10 ** 6 + 10:
            break
        prime[num] = False
        num += i
 
ans = 0
for s in a:
    if prime[s] == True and c[s] == 1:
        ans += 1
 
print(ans)
# Original solution
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = LI()
    N = 10**6
    f = [1]*(N+1)
    a.sort()
    cnt = [0]*(N+1)
    for i in a:
        cnt[i] += 1
    for i in range(N+1):
        if cnt[i] > 1:
            f[i] = 0
    ans = 0
    for i in a:
        if f[i]:
            ans += 1
        x = i
        while x <= N:
            f[x] = 0
            x += i
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()


# Optimized solution
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = LI()
    N = 10**6
    f = [1]*(N+1)
    a.sort()
    cnt = [0]*(N+1)
    for i in a:
        cnt[i] += 1
    for i in range(N+1):
        if cnt[i] > 1:
            f[i] = 0
            x = i
            while x <= N:
                f[x] = 0
                x += i
    ans = 0
    for i in a:
        if f[i]:
            ans += 1
            x = i
            while x <= N:
                f[x] = 0
                x += i
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()
# Original solution
from collections import *
from copy import *
n=int(eval(input()))
a=sorted(list(map(int,input().split())))
l=Counter(a)
m=l.most_common()
f=[False for i in range(max(a)+1)]
ans=0
for i,j in m:
    t=deepcopy(i)
    if f[t]==False and j==1:
               
        ans+=1
        while t<=max(a):
            f[t]=True
            t+=i
    elif f[t]==False and j!=1:
        while t<=max(a):
            f[t]=True
            t+=i
print(ans)

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
dp=[0]*(a[-1]+1)

for i in a :
    dp[i]+=1

for i in a :
    if dp[i] :
        for j in range(i*2,a[-1]+1,i) :
            dp[j]=0

print((dp.count(1)))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = max(a)
che,re = [1 for i in range(b)],[]
for i in a:
    if i in re:
        che[i-1] = 0
    else:
        re.append(i)
        c = b // i
        for j in range(2,c+1):
            che[i*j-1] = 0
ans = 0
for i in re:
    if che[i-1] == 1:
        ans += 1
print(ans)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = max(a)
che = [1 for i in range(b)]
for i in a:
    if che[i-1] == 1:
        c = b // i
        for j in range(2,c+1):
            che[i*j-1] = 0
        che[i-1] = 2
    elif che[i-1] == 2:
        che[i-1] = 0
ans = 0
for i in a:
    if che[i-1] == 2:
        ans += 1
print(ans)
# Original solution
def resolve():
    '''
    code here
    '''
    import math
    import collections
    N = int(eval(input()))

    A_list = [int(item) for item in input().split()]    
    A_list.sort()

    cnt = 0

    while len(A_list) > 0:
        # print(A_list)
        cnt += 1
        temp = A_list[0]
        del A_list[0]

        is_same = False
        for item in A_list[:]:
            if item == temp:
                is_same = True
            if item % temp == 0:
                A_list.remove(item)
        
        if is_same:
            cnt -= 1

    print(cnt)





if __name__ == "__main__":
    resolve()

# Optimized solution
def resolve():
    '''
    code here
    '''
    import collections
    N = int(eval(input()))
    A_list = [int(item) for item in input().split()]

    A_list.sort()


    dp = [0 for item in range(A_list[-1]+1)]
    for item in A_list:

        temp = item
        while temp <= A_list[-1]:
            dp[temp] += 1
            temp += item

    cnt = 0
    for item in A_list:
        if dp[item] == 1:
            cnt += 1
    print(cnt)

if __name__ == "__main__":
    resolve()
# Original solution
import sys
from collections import Counter


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return list(map(int, sys.stdin.readline().strip().split()))


def main():
    n = _i()
    a = list(_ia())
    a.sort()
    c = Counter(a)
    w = set()
    o = []
    m = 10**6 + 1
    for ai in a:
        if ai in w:
            continue
        o.append(ai)
        for j in range(ai+ai, m, ai):
            w.add(j)

    cnt = 0
    for oi in o:
        if c[oi] == 1:
            cnt += 1
    return cnt


if __name__ == "__main__":
    print((main()))


# Optimized solution
import sys
from collections import Counter


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return list(map(int, sys.stdin.readline().strip().split()))


def main():
    _ = _i()
    a = Counter(_ia())
    k = sorted(a.keys())
    m = max(k) + 1
    c = [False for i in range(m)]
    cnt = 0
    for ki in k:
        if c[ki]:
            continue
        if a[ki] == 1:
            cnt += 1
        for j in range(ki+ki, m, ki):
            c[j] = True

    return cnt


if __name__ == "__main__":
    print((main()))
# Original solution
import sys
import collections
import math
input = sys.stdin.readline

def I(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))

n = I()
mylist = sorted(list(MI()))
max_num = int(math.sqrt(mylist[n-1]))
start = mylist[0]
input_list = [0] * n
index = 0

while len(mylist) >= 1:
    temp = mylist.pop(0)
    if not(temp in mylist):
        index += 1
    for j in set(mylist):
        if j % temp == 0:
            while j in mylist:
                mylist.remove(j)
print(index)

# Optimized solution
import sys
import collections
input = sys.stdin.readline

def I(): return int(eval(input()))
def MI(): return list(map(int, input().split()))
def LI(): return list(map(int, input().split()))

def main():
    n = I()
    mylist = list(MI())
    max_a = max(mylist)
    exclude_set = set()
    tlist = [False] * (max_a+1)
    for a in mylist:
        if tlist[a]:
            exclude_set.add(a)
        else:
            tlist[a] = True
    ans = 0
    
    for i in range(1, max_a//2 + 1):
        if not tlist[i]:
            continue
        else:
            for j in range(2*i, max_a+1, i):
                tlist[j]=False
    for i in range(len(tlist)):
        if tlist[i] and not i in exclude_set:
            ans += 1
    print(ans)
                
    

if __name__ == '__main__':
    main()
# Original solution
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(eval(input()))
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7


def get_divisors(n):
    divs = []
    for i in range(2, int(n**0.5)+1):
        c = 0
        while n % i == 0:
            n = n // i
            c += 1
        if c > 0:
            divs.append((i, c))
    if n > 1:
        divs.append((n, 1))
    return divs

N = ri()
A = rl()

import collections
H = collections.defaultdict(set)
D = []
for i, a in enumerate(A):
	divs = get_divisors(a)
	D.append(divs)
	for d, c in divs:
		for j in range(1, c+1):
			k = pow(d, j)
			H[k].add(i)

del_list = set()
for i, divs in enumerate(D):
	s = set(range(N))
	for d, c in divs:
		for j in range(1, c+1):
			k = pow(d, j)
			s &= H[k]
	del_list |= s - set([i])
print((N-len(del_list)))


# Optimized solution
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(eval(input()))
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
A = rl()

A.sort()
m = A[-1]

import collections
h = collections.Counter(A)

ans = 0
for a in A:
	if h[a] == 0:
		continue
	if h[a] == 1:
		ans += 1
	for j in range(a, m+1, a):
		h[j] = 0
print(ans)
# Original solution
from sys import stdin
n = int(eval(input()))
a = list(map(int, stdin.readline().split()))
a.sort()
amax = max(a)+1
e = [True]*amax
Alice = set()
Bob = set()
ans = 0

for i in range(n):
    if e[a[i]] == True:
        Alice.add(a[i])
        for j in range(a[i], amax, a[i]):
            e[j] = False
    else:
        if a[i] in Alice:
            Bob.add(a[i])

print((len(Alice - Bob)))

# Optimized solution
def main():
    from sys import stdin
    n = int(eval(input()))
    a = list(map(int, stdin.readline().split()))
    a.sort()
    amax = max(a)+1
    e = [True]*amax
    Alice = set()
    Bob = set()
    ans = 0
    
    for i in range(n):
        if e[a[i]] == True:
            Alice.add(a[i])
            for j in range(a[i], amax, a[i]):
                e[j] = False
        else:
            if a[i] in Alice:
                Bob.add(a[i])
    
    print((len(Alice - Bob)))
if __name__ == "__main__":
    main()
# Original solution
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def make_divisors(n):  # nの約数を列挙
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def main():
    # 約数
    N = ir()
    A = lr()
    A.sort()
    answer = 0
    bl = [False] * (A[-1]+1)
    used = set()
    for i, a in enumerate(A):
        if i < N-1 and a == A[i+1]:
            bl[a] = True
            continue
        if a in used:
            continue
        used.add(a)
        divs = make_divisors(a)
        flag = True
        for x in divs:
            if bl[x]:
                flag = False
                break
        bl[a] = True
        if flag:
            answer += 1

    print(answer)

main()


# Optimized solution
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
A.sort()
bl = [True] * (A[-1]+1)
answer = 0
for i, a in enumerate(A):
    if i < N-1 and A[i+1] == a:
        pass
    elif bl[a]:
        answer += 1
    if bl[a]:
        bl[a] = False
        next = a + a
        while next <= A[-1]:
            bl[next] = False
            next += a

print(answer)
# Original solution
from collections import Counter

N, *A = list(map(int, open(0).read().split()))

C = Counter(A)
B = sorted(list(C.items()), key=lambda x: x[0])

lim = B[-1][0] + 1

memo = set()
ans = 0
for k, v in B:
    if k in memo:
        continue
    memo |= set(range(k, lim, k))
    ans += (v == 1)

print(ans)

# Optimized solution
N, *A = list(map(int, open(0).read().split()))

A.sort()
lim = A[-1] + 1

dp = [0] * lim
for a in A:
    dp[a] += 1
    if dp[a] == 1:
        for j in range(2 * a, lim, a):
            dp[j] += 2

print((dp.count(1)))
# Original solution
n = int(eval(input()))
lst = list(map(int, input().split()))

lst.sort()

visited = [0 for _ in range(n)]
ans = n
for i in range(n):
  if visited[i] == 0:
    for j in range(i+1,n):
      if lst[j] % lst[i] == 0 and visited[j] == 0:
        ans -= 1
        visited[j] = 1
        if lst[j] == lst[i] and visited[i] == 0:
          ans -= 1
          visited[i] = 1
             
print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))


maxA = max(a)
dp = [0]*(maxA+1)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in a:
    if dp[e] == 1:
        count += 1

print(count)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

O = A.copy()

O = [k for k in O if O.count(k) == 1]

for i in A:
    for j in A:
        if i != j:
            if (i%j == 0):
                if i in O:
                    O.remove(i)

ans = len(O)

print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))


mx = max(A)
x = [0] * (mx + 1) # len(x)
for i in A:
    x[i] += 1
for i in range(1, mx + 1):
    if x[i] != 0:
        for j in range(2 * i, mx + 1, i):
            x[j] = 0
    if x[i] > 1:
        x[i] = 0
print((sum(x)))