CodeEff/ECCO huggingface dataset:
# Original solution
import sys
import heapq
from collections import Counter
from math import sqrt

n = int(eval(input()))
a_s = [int(i) for i in sys.stdin.readline().split()]
a_s.sort()
_max = max(a_s)
ct = Counter(a_s)
cnt = 0
ls = [0] * (10**6+1)
for a in a_s:
    if ls[a] == 1:
        cnt += 1
        continue
    elif ct[a] > 1:
        cnt += 1
    for i in range(a, _max+1):
        if ls[i] == 1:
            continue
        if i % a == 0:
            ls[i] = 1

print((n - cnt))

# Optimized solution
import sys
import heapq
from collections import Counter
from math import sqrt

n = int(eval(input()))
a_s = [int(i) for i in sys.stdin.readline().split()]
a_s.sort()
_max = max(a_s)
ct = Counter(a_s)
cnt = 0
ls = [False] * (10**6+1)
for a in a_s:
    if ls[a]:
        cnt += 1
        continue
    elif ct[a] > 1:
        cnt += 1
    for i in range(a, _max+1, a):
        if ls[i]:
            continue
        if i % a == 0:
            ls[i] = True

print((n - cnt))
# Original solution
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()
memo = [0] * (10**6 + 1)
for i in a:
    for j in range(i, 10**6+1, i):
        memo[j] += 1

ans = 0
for i in a:
    if memo[i] == 1:
        ans += 1
print(ans)

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()
memo = [0] * (10**6 + 1)
f = defaultdict(int)
for i in a:
    if f[i] > 1:
        continue
    f[i] += 1
    for j in range(i, 10**6+1, i):
        memo[j] += 1

ans = 0
for i in a:
    if memo[i] == 1:
        ans += 1
print(ans)
# Original solution
n = int(eval(input()))
a_ls = list(map(int, input().split()))
a_ls.sort(reverse=True)
ans = 0
for i in range(n):
    not_divisible = True
    for j in range(i+1,n):
        if a_ls[i] % a_ls[j] == 0 or a_ls[i] == a_ls[j]:
            not_divisible = False
            break
    if i > 0 and a_ls[i-1] == a_ls[i]:
        not_divisible = False
    if not_divisible:
        ans += 1
print(ans)

# Optimized solution
n = int(eval(input()))
a_ls = list(map(int, input().split()))
a_ls.sort()
a_max = a_ls[-1]
times_ls = [0] * (a_max + 1)
divisible_ls = [0] * (a_max + 1)
for i in range(n):
    base = a_ls[i]
    times_ls[base] += 1
    times = 2
    while base*times <= a_max:
        divisible_ls[base*times] = 1
        times += 1
ans = 0
for i in range(1,a_max+1):
    if times_ls[i] == 1 and divisible_ls[i] == 0:
        ans += 1
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()

m = 10**6+10
d = [False] * (m+1)
ans = 0
for i in range(n):
    same = (i > 0 and a[i] == a[i-1]) or (i < (n-1) and a[i] == a[i+1])
    x = a[i]
    if not d[x] and not same: ans += 1
    for j in range(x, m+1, x):
        d[j] = True
    
print(ans)


# Optimized solution
import sys
input = lambda: sys.stdin.buffer.readline()

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()

m = 10**6+10
d = [False] * (m+1)
ans = 0
for i in range(n):
    same = (i > 0 and a[i] == a[i-1]) or (i < (n-1) and a[i] == a[i+1])
    x = a[i]
    if not d[x] and not same: ans += 1
    
    if (i > 0 and a[i] == a[i-1]): continue
    for j in range(x, m+1, x):
        d[j] = True
    
print(ans)
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
c = Counter(a)
s = []
m = max(a) + 1
ans = 0
for ai in a:
    if ai in s:
        continue
    if c[ai] == 1:
        ans += 1
    for i in range(ai, m, ai):
        s.insert(0, i)
print(ans)

# Optimized solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
c = Counter(a)
m = max(a) + 1
dp = [False]*m
ans = 0
for ai in a:
    if dp[ai]:
        continue
    if c[ai] == 1:
        ans += 1
    for i in range(ai, m, ai):
        dp[i] = True
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
Adic={}
for i in range(N):
  if A[i] not in Adic:
    Adic[A[i]] = 1
  else:
    Adic[A[i]] += 1
Aset = set(A)
if 1 in Aset: #1がある場合
  if Adic[1] == 1:
    print((1))
  else:
    print((0))
  exit()
ans = 0
for j in range(N):
  Flag = True
  temp = A[j]
  i = 2
  if Adic[temp] >= 2:
    continue
  for i in range(2, int(temp**0.5)+1):
    #print(i,temp)
    if temp%i == 0:
      #print(i,temp//i,temp)
      if i in Aset or temp//i in Aset:
        Flag = False
        #print(i,temp//i,"X")
        break
    #if temp%2 !=0: #奇数の時
    #  if i == 2:
    #    i = 3
    #  else:
    #    i += 2
    #else:
    #  i += 1
  if not Flag:
    continue
  ans += 1
print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
MAX = max(A) #Aの中の最大値
Adic={}
for i in range(N):
  if A[i] not in Adic:
    Adic[A[i]] = 1
  else:
    Adic[A[i]] += 1
Aset = set(A)
if 1 in Aset: #1がある場合
  if Adic[1] == 1:
    print((1))
  else:
    print((0))
  exit()
ans = 0
for j in range(N):
  temp = A[j]
  if Adic[temp] >= 2: #同じ数が複数ある場合には削除
    if temp in Aset:
      Aset.remove(temp)
  fmax = MAX//temp
  #print(fmax,temp)
  for i in range(2,fmax+10): #fmaxまで見る
    now = temp*i
    if now in Aset:
      Aset.remove(now)
#print(Aset)
print((len(Aset)))
# Original solution
from collections import Counter
n = int(eval(input()))
a = sorted(list(map(int,input().split())),reverse=True)
c = Counter(a)
s = list (set(a))
dp = [True] * (10**6+1)

for x in s:
    e = x*2
    # エラトステネスの篩
    while e <= 10 ** 6:
        dp[e] = False
        e += x

ret = 0
for x in a:
    # 重複なし かつ 素数
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)

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

for x in s:
    e = x*2
    # エラトステネスの篩
    while e <= 10 ** 6:
        dp[e] = False
        e += x

ret = 0
for x in a:
    # 重複なし かつ 素数
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int,input().split()))
c = Counter(a)
s = list (set(a))
dp = [True] * (10**6+1)

for x in s:
    e = x*2
    # エラトステネスの篩
    while e <= 10 ** 6:
        dp[e] = False
        e += x

ret = 0
for x in a:
    # 重複なし かつ 素数
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)

# Optimized solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
dp = [True] * (10 ** 6 + 1)
s = list(set(a))
for x in s:
    e = x * 2
    while e <= 10 ** 6:
        dp[e] = False
        e += x
ret = 0
for x in a:
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
dp = [True] * (10 ** 6 + 1)
s = list(set(a))
for x in s:
    e = x * 2
    while e <= 10 ** 6:
        dp[e] = False
        e += x
ret = 0
for x in a:
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)


# Optimized solution
from collections import Counter
n = int(eval(input()))
a = sorted(list(map(int, input().split())))
c = Counter(a)
maxa = a[-1]+1
dp = [True] * maxa
s = list(set(a))
for x in s:
    for j in range(x*2,maxa,x):
        dp[j] = False
ret = 0
for x in a:
    if c[x] == 1 and dp[x] == True:
        ret += 1
print(ret)
# Original solution
n, *a = list(map(int, open(0).read().split()))           
a.sort()                                           
s = set()                                          
checked = set()                                    
dup = set()                                        
count = 0                                          
for x in a:                                        
    if x in s:                                     
        if x in checked:                           
            dup.add(x)                             
        continue                                   
    count += 1                                     
    checked.add(x)                                 
    for i in range(1, 10**6 // x + 1):             
        s.add(x * i)                               
                                                   
print((count - len(dup)))                            

# Optimized solution
n, *a = list(map(int, open(0).read().split()))
a.sort()
am = a[-1] + 1
dp = [True] * am
ans = 0
dup = set()
for x in a:
    d = dp[x]
    if d:
        ans += 1
        for i in range(x, am, x):
            dp[i] = False
        dp[x] = None
    elif d == None:
        dup.add(x)

print((ans - len(dup)))
# Original solution
from collections import deque

N = int(eval(input()))
A = [[int(x)] for x in input().split()]

def merge(s, t):
    u = []

    while s + t:
        
        if s == [] or t == []:
            return u + s + t

        if s[0] <= t[0]:
            u.append(s[0])
            s = s[1:]
        else: # s0 > t0
            u.append(t[0])
            t = t[1:]

    return u

while len(A) > 1:
    B = []
    for i in range(len(A) // 2):
        B.append(merge(A[2 * i], A[2 * i + 1]))
    if len(A) % 2 == 1:
        B.append(A[len(A) - 1])
    A = B

A = A[0]
check = [True for _ in range(N)]

for i in range(N):
    if check[i] == True:
        a = A[i]
        for j in range(i + 1, N):
            if check[j] == True:
                if A[j] % a == 0:
                    check[j] = False
                    if j == i + 1:
                        if A[j] <= a:
                            check[i] = False

ans = check.count(True)
                            
print(ans)

# Optimized solution
N = int(eval(input()))
A = [int(x) for x in input().split()]
M = max(A)

count = [0] * (M + 1)
for i in range(N):
    count[A[i]] += 1

check = [True] * (M + 1)
for a in range(1, M + 1):
    if count[a] > 0 and check[a] == True:
        for k in range(2, M // a + 1):
            check[a * k] = False      

ans = 0
for i in range(N):
    if count[A[i]] == 1 and check[A[i]] == True:
        ans += 1

print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

a.sort()
a_set = set(a)
for i in range(n-1):
    if a[i] == a[i + 1]:
        if a[i] in a_set:
            a_set.remove(a[i])

dp = [True for _ in range(max(a) + 1)]
ans = 0
y = -1
for x in a:
    if x == y:
        continue
    y = x

    if x in a_set:
        ans += 1 if dp[x] else 0

    while y <= max(a):
        dp[y] = False
        y += x

print(ans)


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

a.sort()
a_set = set(a)
for i in range(n-1):
    if a[i] == a[i + 1]:
        if a[i] in a_set:
            a_set.remove(a[i])

ma = max(a)

dp = [True for _ in range(ma + 1)]
ans = 0
y = -1
for x in a:
    if x == y:
        continue
    y = x

    if x in a_set:
        ans += 1 if dp[x] else 0

    while y <= ma:
        dp[y] = False
        y += x

print(ans)
# Original solution
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)

# Optimized solution
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)
# Original solution
def main():
    n = int(eval(input()))
    a = tuple(map(int, input().split()))

    ans = 0
    for i in range(len(a)):
        if a.count(a[i]) > 1:
            continue
        divisors = set()
        for j in range(1, int(a[i] ** 0.5) + 1):
            if a[i] % j == 0:
                divisors.add(j)
                if j != a[i] // j:
                    divisors.add(a[i] // j)
        if len(set(a) & divisors) == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n = int(eval(input()))
    a = tuple(map(int, input().split()))

    ans = 0
    mx = max(a) + 1
    dp = [0] * mx
    for i in a:
        for j in range(i, mx, i):
            dp[j] += 1
    for i in a:
        if dp[i] == 1:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()
# Original solution
def main():
    n = int(eval(input()))
    a = tuple(map(int, input().split()))

    ans = 0
    mx = max(a) + 1
    dp = [0] * mx
    for i in a:
        for j in range(i, mx, i):
            dp[j] += 1
    for i in a:
        if dp[i] == 1:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
def main():
    _ = int(eval(input()))
    a = list(map(int, input().split()))
    a.sort()
    a = tuple(a)

    ans = 0
    mx = max(a) + 1
    dp = [0] * mx
    for i in a:
        if dp[i] == 2:
            continue
        else:
            for j in range(i, mx, i):
                dp[j] += 1
    for i in a:
        if dp[i] == 1:
            ans += 1

    print(ans)


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

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

c = Counter(a)
nu = {k for k, v in list(c.items()) if v > 1}

s = set()
for aa in a:
    m = 2
    while aa*m <= 10**6:
        s.add(aa*m)
        m += 1

o = 0
for aa in a:
    if aa in s or aa in nu:
        continue
    o += 1

print(o)


# Optimized solution
from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
mx = max(a)

c = Counter(a)
nu = {k for k, v in list(c.items()) if v > 1}

s = set()
u = set()
for aa in a:
    m = 2
    if aa in s or aa in u:
        continue
    u.add(aa)
    while aa*m <= mx:
        s.add(aa*m)
        m += 1

o = 0
for aa in a:
    if aa in s or aa in nu:
        continue
    o += 1

print(o)
# Original solution
n = int(eval(input()))
a = sorted(map(int, input().split()))

cnt = [0] * (max(a) + 1)
for i in a:
    cnt[i] += 1
for i in set(a):
    if cnt[i] >= 1:
        for j in range(i * 2, max(a) + 1, i):
            cnt[j] = 0
print((cnt.count(1)))


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

cnt = [0] * (a[-1] + 1)
for i in a:
    cnt[i] += 1
for i in set(a):
    if cnt[i] >= 1:
        for j in range(i * 2, a[-1] + 1, i):
            cnt[j] = 0
print((cnt.count(1)))
# Original solution
import collections
N = int(eval(input()))
A = sorted([int(i) for i in input().split()])
C = collections.Counter(A)
tested = [True for i in range(10**7+1)]

ans = 0
for i in range(N):
    if C[A[i]] == 1 and tested[A[i]] is True:
        ans += 1

    for j in range(A[i], 10**6+1, A[i]):
        tested[j] = False
print(ans)


# Optimized solution
import collections
N = int(eval(input()))
A = sorted([int(i) for i in input().split()])
C = collections.Counter(A)
tested = [True for i in range(10**7+1)]

ans = 0
for i in range(N):
    if tested[A[i]] is True:
        for j in range(A[i], 10**6+1, A[i]):
            tested[j] = False
        if C[A[i]] == 1:
            ans += 1
print(ans)
# Original solution
from collections import Counter

def main():
    N = int(eval(input()))
    *A, = list(map(int, input().split()))
    A.sort()
    C = Counter(A)

    MAX = 2000005
    T = [0]*MAX

    ans = 0
    for a in A:
        if T[a]:
            continue
        else:
            if C[a] == 1:
                ans += 1
            for i in range(2*a, MAX, a):
                T[i] += 1
    print(ans)

if __name__ == '__main__':
    main()


# Optimized solution
from collections import Counter

def main():
    N = int(eval(input()))
    *A, = list(map(int, input().split()))
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in list(C.keys()):
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in list(C.items()):
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    
    A_dict = {}
    for a in A:
        if a in list(A_dict.keys()):
            A_dict[a] += 1
        else:
            A_dict[a] = 1

    A_remain = sorted(A_dict.keys())
    limit = A_remain[-1] / 2
    prime = []
    a = A_remain[0]

    while a<=limit and len(A_remain)>0:
        a = A_remain[0]
        prime.append(a)
        A_remain = [i for i in A_remain[1:] if i%a != 0]

    prime.extend(A_remain)
    print((sum([1 for i in prime if A_dict[i]==1])))

main()

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

    A_dict = {}
    for a in A:
        if a in list(A_dict.keys()):
            A_dict[a] += 1
        else:
            A_dict[a] = 1

    A_list = sorted(A_dict.keys())
    limit = A_list[-1]

    sieve = {i: True for i in list(A_dict.keys())}

    for a in A_list:
        if not sieve[a]:
            continue
        for i in range(2*a, limit+1, a):
            if i in sieve:
                sieve[i] = False

    print((sum([1 for i in list(sieve.keys()) if sieve[i] and (A_dict[i]==1)])))
main()
# Original solution
import bisect as bc
from collections import defaultdict
from collections import deque
N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()
q = set([i for i in range(N)])
 
for i in range(N):
    ai = A[i]
    itr = list(q)
    for j in itr:
        if j == i:
            continue
        if A[j] % ai == 0:
            q.remove(j)
 
print((len(q)))
 
 

# Optimized solution
import bisect as bc

N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()

dp = [True for _ in range(A[-1]+1)]

for i in range(N):
    ai = A[i]
    for j in range(2,A[-1]+1):
        if ai*j > A[-1]:
            break
        if dp[ai*j]:
            dp[ai*j] = False

ans = 0
finish = [True for _ in range(A[-1]+1)]
for i in range(N):
    if dp[A[i]] and finish[A[i]]:
        if bc.bisect_right(A,A[i]) - bc.bisect_left(A,A[i]) == 1:
            ans += 1
            finish[A[i]] = False

print(ans)
# Original solution
import bisect as bc

N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()

dp = [True for _ in range(A[-1]+1)]

for i in range(N):
    ai = A[i]
    for j in range(2,A[-1]+1):
        if ai*j > A[-1]:
            break
        dp[ai*j] = False

ans = 0
finish = [True for _ in range(A[-1]+1)]
for i in range(N):
    if dp[A[i]] and finish[A[i]]:
        if bc.bisect_right(A,A[i]) - bc.bisect_left(A,A[i]) == 1:
            ans += 1
            finish[A[i]] = False

print(ans)




# Optimized solution
import bisect as bc
 
N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()
 
dp = [True for _ in range(A[-1]+1)]
 
for i in range(N):
    ai = A[i]
    for j in range(2,A[-1]+1):
        if ai*j > A[-1]:
            break
        dp[ai*j] = False
 
ans = 0
for i in range(N):
    if dp[A[i]]:
        if bc.bisect_right(A,A[i]) - bc.bisect_left(A,A[i]) == 1:
            ans += 1
 
print(ans)
# Original solution
n = int(eval(input()))
a_l = list(map(int, input().split()))

# 0 ~ 10**6のリスト
A_list = [True for i in range(10**6+1)]
# 倍数のところにFalseを入れる
for i in a_l:
	for j in range(i*2, 10**6+1, i):
		A_list[j] = False

# 0 ~ 10**6に入力値の個数を入れる
# (count()で数えると、o(n**2)になるため)
val_list = [0 for i in range(10**6+1)]
for i in a_l:
	val_list[i] += 1

# Trueと一致するa_lの個数を数える
cnt = 0
for i in a_l:
	if(val_list[i] != 1):
		continue
	if(A_list[i]):
		cnt += 1

print(cnt)

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

# 0 ~ 10**6に入力値の個数を入れる
# (count()で数えると、o(n**2)になるため)
val_list = [0 for i in range(10**6+1)]
for i in a_l:
	val_list[i] += 1

# 重複削除
a_l = list(set(a_l))

# 0 ~ 10**6のリスト
A_list = [True for i in range(10**6+1)]
# 倍数のところにFalseを入れる
for i in a_l:
	for j in range(i*2, 10**6+1, i):
		A_list[j] = False

# Trueと一致するa_lの個数を数える
cnt = 0
for i in a_l:
	if(val_list[i] != 1):
		continue
	if(A_list[i]):
		cnt += 1

print(cnt)
# Original solution
import math
n = int(eval(input()))
ai = [int(i) for i in input().split()]

ai.sort()

sqr_max_val = int(ai[n-1]**0.5)
max_val = ai[n-1]
#print(ai)
ai_ex = [0]*(2*10**6)
#ai_ex = [0]*(30)

for i in range(n):
    ai_ex[ai[i]-1] += 1

for i in range(n):
    if ai_ex[ai[i]-1] > 1:
        ai_ex[ai[i]-1] = 0
    """
    if ai[i] > sqr_max_val:
        break
    """
    tmp = ai[i]
    baisu = 2
    #print(ai[i])
    while tmp * baisu <=  max_val:
        ai_ex[tmp*baisu-1] = 0
        #print(tmp*baisu)
        baisu += 1
"""
for i in range(100):
    if ai_ex[i] == 1:
        a = 1
        #print(i)
"""
print((sum(ai_ex)))
#print(ai_ex)

# Optimized solution
import math
n = int(eval(input()))
ai = [int(i) for i in input().split()]

ai.sort()

sqr_max_val = int(ai[n-1]**0.5)
max_val = ai[n-1]
#print(ai)
ai_ex = [0]*(2*10**6)
#ai_ex = [0]*(30)

for i in range(n):
    ai_ex[ai[i]-1] += 1

for i in range(n):
    if ai_ex[ai[i]-1] == 0:
        continue
    if ai_ex[ai[i]-1] > 1:
        ai_ex[ai[i]-1] = 0
    """
    if ai[i] > sqr_max_val:
        break
    """
    tmp = ai[i]
    baisu = 2
    #print(ai[i])
    while tmp * baisu <=  max_val:
        ai_ex[tmp*baisu-1] = 0
        #print(tmp*baisu)
        baisu += 1
"""
for i in range(100):
    if ai_ex[i] == 1:
        a = 1
        #print(i)
"""
print((sum(ai_ex)))
#print(ai_ex)
# Original solution
from itertools import combinations

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    a = sorted(a, reverse=True)

    x = {}
    for i in a:
        x[i] = True

    for i in range(0, n - 1):
        for j in range(i + 1, n):
            if a[i] % a[j] == 0:
                x[a[i]] = False
                break

    ans = 0
    for i in list(x.values()):
        if i:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()


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

    max_a = max(a) + 1
    dp = [True] * max_a

    for idx in range(len(a)):
        if idx + 1 != len(a) and a[idx] == a[idx + 1]:
            dp[a[idx]] = False
        i = a[idx]
        x = 2
        while i * x < max_a:
            dp[i * x] = False
            x += 1

    ans = 0
    for i in a:
        if dp[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()