CodeEff/ECCO huggingface dataset:
# Original solution
def main():
    import os
    import sys
    from io import BytesIO, IOBase
    
    BUFSIZE = 8192
    
    
    class FastIO(IOBase):
        newlines = 0
    
        def __init__(self, file):
            self._fd = file.fileno()
            self.buffer = BytesIO()
            self.writable = "x" in file.mode or "r" not in file.mode
            self.write = self.buffer.write if self.writable else None
    
        def read(self):
            while True:
                b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
                if not b:
                    break
                ptr = self.buffer.tell()
                self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
            self.newlines = 0
            return self.buffer.read()
    
        def readline(self):
            while self.newlines == 0:
                b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
                self.newlines = b.count(b"\n") + (not b)
                ptr = self.buffer.tell()
                self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
            self.newlines -= 1
            return self.buffer.readline()
    
        def flush(self):
            if self.writable:
                os.write(self._fd, self.buffer.getvalue())
                self.buffer.truncate(0), self.buffer.seek(0)
    
    
    class IOWrapper(IOBase):
        def __init__(self, file):
            self.buffer = FastIO(file)
            self.flush = self.buffer.flush
            self.writable = self.buffer.writable
            self.write = lambda s: self.buffer.write(s.encode("ascii"))
            self.read = lambda: self.buffer.read().decode("ascii")
            self.readline = lambda: self.buffer.readline().decode("ascii")
    
    
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
    input = lambda: sys.stdin.readline().rstrip("\r\n")
    mod = 10**9 + 7
    n = int(eval(input()))
    a = [int(x) for x in input().split()]
    a_set = set(a)
    #約数の列挙
    def make_divisors(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
    from collections import Counter
    c = Counter(a)
    cnt = 0
    for i in a:
        prime = make_divisors(i)
        flag = 1
        if c[i] > 1:
            continue
        for j in prime:
            if j == i:
                continue
            if j in a_set:
                flag = 0
                break
        if flag:
            cnt += 1
    print(cnt)
main()


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

n = int(eval(input()))
a = [int(x) for x in input().split()]
a.sort()
max_a = a[-1]
is_True = [1]*(max_a + 1)
for i in a:
    if is_True[i]:
        for j in range(2*i, max_a + 1, i):
            is_True[j] = False
cnt = 0
from collections import Counter
c = Counter(a)
for i in a:
    if is_True[i] and c[i] == 1:
        cnt += 1
print(cnt)
# Original solution
import collections
N = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A)
c = collections.Counter(A)
cnt = 0
max = int(10e5+1)
l = [0] * (max+1)
for n in A:
    for j in range(n, max+1, n):
        l[j] += 1
for n in A:
    if c[n] > 1:
        continue
    if l[n] == 1:
        cnt += 1
print(cnt)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
cnt = 0
max = int(10e5+1)
l = [0] * (max+1)
for n in A:
    if l[n] != 0:
        l[n] = 2
        continue
    for j in range(n, max+1, n):
        l[j] += 1
for n in A:
    if l[n] == 1:
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
INF = 10**6+1
lis = [1]*INF
exist = [0]*INF
for i in range(N):
    a = A[i]
    exist[a] += 1
    if lis[a]:
        q = 2
        while a*q < INF:
            lis[a*q] = 0
            q += 1
cnt = 0
for a in A:
    if lis[a] and exist[a] == 1:
        cnt += 1
print(cnt)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
INF = 10**6+1
lis = [1]*INF
exist = [0]*INF
for i in range(N):
    a = A[i]
    if lis[a] and exist[a] < 1:
        q = 2
        while a*q < INF:
            lis[a*q] = 0
            q += 1
    exist[a] += 1
cnt = 0
for a in A:
    if lis[a] and exist[a] == 1:
        cnt += 1
print(cnt)
# Original solution
from collections import defaultdict

def main():
    MOD = 10**9+7
    n = int(eval(input()))
    A = list(map(int,input().split()))

    dp = [True] * (max(A)+1)

    for a in A:
        c = 2
        while a*c <= max(A):
            dp[a*c] = False
            c += 1
    

    d = defaultdict(int)

    for a in A:
        d[a] += 1

    ans = 0
    for a in A:
        if dp[a] == True and d[a]==1:
            ans += 1
    print(ans)

main()

# Optimized solution
from collections import defaultdict

def main():
    MOD = 10**9+7
    n = int(eval(input()))
    A = list(map(int,input().split()))

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

    dp = [True] * T

    d = defaultdict(int)

    for a in A:
        d[a] += 1
        if dp[a]:
            for j in range(2*a,T,a):
                dp[j] = False

    ans = 0
    
    for a in A:
        if d[a] == 1 and dp[a] == True:
            ans += 1

    print(ans)

main()
# Original solution
from collections import Counter
from operator import mul
from functools import reduce


n = int(eval(input()))
A = list(map(int, input().split()))
cnt_a = Counter(A)
memo = [1] * 1000001
for a in A:
    memo[a] = 1
A.sort()
for a in A:
    for i in range(a * 2, 1000001, a):
        memo[i] = -1
for l in list(cnt_a.keys()):
    if cnt_a[l] >= 2:
        memo[l] = "daburi"
ans = 0
for a in A:
    if memo[a] == 1:
        ans += 1
print(ans)


# Optimized solution
from collections import Counter
from operator import mul
from functools import reduce


n = int(eval(input()))
A = list(map(int, input().split()))
cnt_a = Counter(A)
memo = [1] * 1000001
for a in A:
    memo[a] = 1
A.sort()
a_max = max(A)
for a in A:
    if not memo[a]:
        continue
    for i in range(a * 2, a_max + 1, a):
        memo[i] = -1
for l in list(cnt_a.keys()):
    if cnt_a[l] >= 2:
        memo[l] = "daburi"
ans = 0
for a in A:
    if memo[a] == 1:
        ans += 1
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
U = [0]*(10**6+1)
for e in A:
    U[e] += 1
ans = 0
for k in range(1,10**6+1):
    if U[k] == 1:
        ans += 1
    if U[k] > 0:
        for l in range(2*k,max(A)+1,k):
            if U[l] > 0:
                U[l] += 1
print(ans)


# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
U = [0]*(10**6+1)
for e in A:
    U[e] += 1
ans = 0
for k in range(1,max(A)+1):
    if U[k] == 1:
        ans += 1
    if U[k] > 0:
        for l in range(2*k,10**6+1,k):
            if U[l] > 0:
                U[l] += 1
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
U = [0]*(10**6+1)
for e in A:
    U[e] += 1
ans = 0
for k in range(1,max(A)+1):
    if U[k] == 1:
        ans += 1
    if U[k] > 0:
        for l in range(2*k,10**6+1,k):
            if U[l] > 0:
                U[l] += 1
print(ans)


# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
m = max(A)
U = [0]*(m+1)
for e in A:
    U[e] += 1
ans = 0
for k in range(1,m+1):
    if U[k] == 1:
        ans += 1
    if U[k] > 0:
        for l in range(2*k,m+1,k):
            if U[l] > 0:
                U[l] += 1
print(ans)
# Original solution
X=10**6+1
E=[1 for i in range(X)]
E[0]=0
N=int(eval(input()))
A=list(map(int,input().split()))

import copy
B=copy.deepcopy(A)
B.sort()

D={}
for i in range(N):
    if A[i] not in D:
        D[A[i]]=1
    else:
        D[A[i]]=2
ANS=0
for i in range(N):
    if D[B[i]]==2:
        for j in range(1,10**7):
            if B[i]*j>=len(E):
                break
            else:
                E[B[i]*j]=0
    else:
        if E[B[i]]!=0:
            ANS+=1
            for j in range(1,10**7):
                if B[i]*j>=len(E):
                    break
                else:
                    E[B[i]*j]=0
print(ANS)
                

# Optimized solution
X=10**6+1
E=[1 for i in range(X)]
E[0]=0
N=int(eval(input()))
A=list(map(int,input().split()))

import copy
B=copy.deepcopy(A)
B.sort()

D={}
for i in range(N):
    if A[i] not in D:
        D[A[i]]=1
    else:
        D[A[i]]=2
ANS=0
for i in range(N):
    if D[B[i]]==2 and E[B[i]]==1:
        for j in range(1,10**7):
            if B[i]*j>=len(E):
                break
            else:
                E[B[i]*j]=0
    elif D[B[i]]==2 and E[B[i]]==0:
        continue
    else:
        if E[B[i]]!=0:
            ANS+=1
            for j in range(1,10**7):
                if B[i]*j>=len(E):
                    break
                else:
                    E[B[i]*j]=0
print(ANS)
# Original solution
def make_divisors(n):
  lower_divisors , upper_divisors = [], []
  i = 1
  while i*i <= n:
    if n % i == 0:
      lower_divisors.append(i)
      if i != n // i:
        upper_divisors.append(n//i)
    i += 1
  return lower_divisors + upper_divisors[:0:-1]

N = int(eval(input()))
As = list(map(int, input().split()))
st = set(As)
Fs = [0]*N
 
As.sort()
if N == 1:
  print((1))
  exit()
else:
  rlt = 1
  
for i in range(1,N):
  if As[i] == As[i-1]:
    Fs[i] = 1
    if Fs[i-1] == 0:
      rlt -= 1
    continue
  ls =  make_divisors(As[i])
  for l in ls:
    flag = 0
    if l in st:
      Fs[i] = 1
      flag = 1
      break
  if flag == 0:
    rlt += 1
    
print(rlt)

# Optimized solution
N = int(eval(input()))
As = list(map(int, input().split()))
 
As.sort()
 
st = set(As)
m = As[-1]
rlt = 0
Fs = [1]*(m+1)
 
for i in range(N):
  if i > 0 and As[i] == As[i-1]:
    Fs[As[i]] = 0
    continue
  j = 2
  while As[i]*j <= m:
    Fs[As[i]*j] = 0
    j += 1

for a in As:
  rlt += Fs[a]
    
print(rlt)
# Original solution
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
A = list(map(int, input().split()))
maxA = max(A)
nums = set()
A.sort()
sA = list(set(A))
cnt = 0 
ans = defaultdict(int)
for a in sA:
    new = False
    if not(a in nums):
        cnt += 1
        ans[a] += 1
        new = True
    nums.add(a)
    # while new and a + mlt < maxA+2:
    if new:
        for val in range(a+a, maxA+2, a):
            nums.add(val)

for an in ans.keys():
    if A.count(an)>1:
        cnt -= 1
print(cnt)


# Optimized solution
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
A = list(map(int, input().split()))
A.sort()
C = Counter(A)
S = set(A)

maxA = A[-1]
chk = [0] * (maxA+1)
for s in S:
    for i in range(s, maxA+1, s):
        chk[i] += 1

res = [s for s in S if chk[s] == 1 and C[s] == 1]
# print(res)
print(len(res))
# Original solution
N = int(eval(input()))
nums = list(map(int, input().split()))

checked = [0 for _ in range(N)]
nums.sort()
answer = N
for i, num in enumerate(nums):
  if checked[i] == 1:
    continue
  else:
    if i == N-1:
      break
    same = False
    for j in range(i+1, N):
      if nums[j]%num == 0 and checked[j] == 0:
        checked[j] = 1
        answer -= 1
        if nums[j] == num:
          same = True
    if same:
      answer -= 1
print(answer)

# Optimized solution
N = int(eval(input()))
nums = list(map(int, input().split()))
nums.sort()
checked = [0 for _ in range(nums[-1]+1)]
answer = 0
for i in range(N-1):
  if checked[nums[i]] == 1:
    continue
  else:
    if nums[i] != nums[i+1]:
      answer += 1
    count = 1
    temp = nums[i]
    while(temp <= nums[-1]):
      checked[temp] = 1
      count += 1
      temp= nums[i]*count
if checked[nums[-1]] == 0:
  answer += 1
print(answer)
# Original solution
from math import sqrt
N = int(eval(input()))
A = list(map(int, input().split()))

ans = 0
for i, val in enumerate(A):
    curr_set = set(A[:i] + A[i+1:])
    if val in curr_set:
        continue
    for j in range(1, int(sqrt(val)) + 1):
        if (val % j == 0 and j in curr_set) or val / j in curr_set:
            break
    else:
        ans += 1
print(ans)

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

A.sort()
max_A = A[-1]
arr = [0] * (max_A + 1)

for val in A:
    arr[val] += 1
    if arr[val] == 1:
        for j in range(2*val, max_A + 1, val):
            arr[j] += 2

print((arr.count(1)))
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
count = 0
A.sort()
c= 0
if N>1:
    if A[0]%A[1] >0:
        count+=1

for k in range(1, len(A)):
    if k<N-1:
        if A[k] == A[k+1]:
            continue
    for j in range(c, k):
        if A[k]%A[j] ==0:
            del A[k]
            A.insert(0, 0)
            c +=1
            break
    else:
        count +=1
        #print(A[k])

    
if N ==1:
    count = 1
print(count)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
count = 0
A.sort()
c=0
"""
for k in range(len(A)-1):
    if A[k] == A[k+1]:
        del A[k]
        A.insert(0,0)
        c+=1
        if k <len(A)-2:
            if A[k+1] != A[k+2]:
                del A[k+1]
                A.insert(0,0)
                c+=1
        else:
            del A[k+1]
            A.insert(0,0)
            c+=1
del A[:c]
if len(A)>0:
    saidai = A[-1]
else:
    saidai=0
#print(A)
"""
saidai = A[-1]
foo = [0 for k in range(saidai+1)]
for k in range(len(A)):
    if foo[A[k]] == 1:
        continue
    else:
        for j in range(A[k], saidai+1, A[k]):
            foo[j] = 1
        if k < len(A)-1:
            if A[k] == A[k+1]:
                continue
        if 0 < k < len(A):
            if A[k] == A[k-1]:
                continue
        count+=1
print(count)
# Original solution
n = int(eval(input()))
A = list(map(int, input().split()))

N = 10 ** 6 + 1

# 一度しか現れないものを抽出する
cnt = [0] * (N + 1)
for a in A:
    cnt[a] += 1

once = []
for a in A:
    if cnt[a] == 1:
        once.append(a)

# 倍数を排除
bl = [True] * (N + 1)
A = list(set(A))
for elem in A:
    for m in range(elem * 2, N + 1, elem):
        bl[m] = False

res = 0
for elem in once:
    if bl[elem]:
        res += 1
print(res)


# Optimized solution
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
from collections import Counter
c = Counter(A)

MAX = 10 ** 6 + 1000
dp = [True] * MAX

for k, v in list(c.items()):
    if dp[k] == False: continue
    if v > 1: dp[k] = False
    for x in range(k + k, MAX, k):
        dp[x] = False

res = 0
for x in range(n):
    if dp[A[x]]: res += 1
print(res)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
max_a = max(a)
b = [False] * (max_a + 1)
a.sort()
a = a + [0]
b[a[0]] = True
count = 0
for i in range(1, n):
    flg = True
    if b[a[i]]:
        continue
    for j in range(i - 1, -1, -1):
        if a[i] % a[j] == 0 or a[i] == a[i+1]:
            flg = False
            b[a[i]] = True
            k = 2
            while k*a[i] < max_a:
                b[k*a[i]] = True
                k += 1
            break
    if flg:
        count += 1

if a[0] != a[1]:
    count += 1
print(count)


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

for i in a:
    b[i] += 1
    if b[i] == 1:
        for j in range(2*i, max_a + 1, i):
            b[j] += 2
print((b.count(1)))
# Original solution
import sys
from collections import Counter
input = sys.stdin.readline
n = int(eval(input()))
a = list(map(int,input().split()))
ansList = [1]*n

for i in range(n):
    if ansList[i] == 1:
        for j in range(i+1,n):
            if a[i]%a[j] == 0:
                ansList[i] = 0
            if a[j]%a[i] == 0:
                ansList[j] = 0

c = Counter(ansList)
print((c[1]))

# Optimized solution
# 解説を見て解きました。

n = int(eval(input()))
a = sorted(list(map(int,input().split())))
# aの最大値+1(0を含むので)
m_a = a[-1]+1
# dp[i](aの最小値<=i<=aの最大値)が1の個数の合計が答え
dp = [0]*m_a

for i in a:
    # dp[i]の初期値は0なので1を足す
    dp[i] += 1
    # dp[i]が2以上の時は列挙する必要がないのでパス
    if dp[i] == 1:
        # aの最大値までのiの倍数を列挙
        for j in range(i*2, m_a, i):
            # 倍数をはじくためにdp[j]を2以上にする
            dp[j] += 2

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

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

for i,num in enumerate(a):
    if dp[num-1]:
        j= 2 * num
        while j <= max(a):
            dp[j-1] = False
            j += num
        if not i+1==len(a):
            if a[i]==a[i+1]:
                dp[num-1] = False

for k in a:
    if dp[k-1]:
        ans += 1

#print(dp)
print(ans)

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

a.sort()
dp = [True] * a[-1]
ans = 0

for i,num in enumerate(a):
    if dp[num-1]:
        j= 2 * num
        while j <= a[-1]:
            dp[j-1] = False
            j += num
        if not i+1==len(a):
            if a[i]==a[i+1]:
                dp[num-1] = False

for k in a:
    if dp[k-1]:
        ans += 1

#print(dp)
print(ans)
# Original solution
n = int(eval(input()))
A = list(map(int,input().split()))
L = [0]*(10**6+1)

for a in A:
    temp = a
    while temp < 10**6+1:
        L[temp] += 1
        temp += a

ans = 0
for a in A:
    if L[a] == 1:
        ans += 1

print(ans)


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

A_max = max(A)
L = [0]*(A_max+1)
A.sort()

for a in A:
    temp = a
    while temp < A_max+1:
        L[temp] += 1
        temp += a

ans = 0
for a in A:
    if L[a] == 1:
        ans += 1

print(ans)
# Original solution
from collections import Counter
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N, *A = list(map(int, read().split()))

    t = Counter(A)
    A.sort()
    table = [True] * (A[-1] + 1)
    n = len(table)

    seen = set()
    for a in A:
        if a in seen:
            continue
        for i in range(2*a, n, a):
            table[i] = False
        seen.add(a)

    ans = 0
    for k, v in list(t.items()):
        if v > 1:
            continue
        else:
            if table[k]:
                ans += 1

    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,*A = list(map(int, read().split()))

    A.sort()
    table = [0] * (A[-1] + 1)
    n = len(table)

    for a in A:
        if table[a] > 1:
            continue

        if table[a] == 0:
            for i in range(2*a, n, a):
                table[i] = 2
        
        table[a] += 1

    ans = 0
    for a in A:
        if table[a] == 1:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()
# Original solution
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list([x-1 for x in MII()])
def get_primes(n=10**3):
    is_prime = [True]*(n+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, n+1, i): is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]
def prime_factor(n):
    res = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0: res.append(i); n //= i
    if n != 1: res.append(n)
    return res
#======================================================#
def main():
    n = II()
    aa = MII()
    aa.sort()
    lst = []
    ans = []
    while aa:
        x = aa[0]
        lst = []
        flag=False
        for a in aa[1:]:
            if a%x!=0:
                lst.append(a)
            else:
                if a==x:
                    flag=True
        if not flag:
            ans.append(x)
        aa = lst
        # print(ans)
    print((len(ans)))


if __name__ == '__main__':
    main()

# Optimized solution
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list([x-1 for x in MII()])
#======================================================#
def main():
    n = II()
    aa = MII()
    aa.sort()
    maxa = aa[-1]
    dp = [False]*(maxa+1)
    for a in aa:
        dp[a] = True
    dup = set()
    for a in aa:
        if a in dup:
            dp[a] = False
            continue
        else:
            dup.add(a)
        if dp[a]:
            for j in range(a*2,maxa+1,a):
                dp[j] = False
    print((sum(1 for d in dp if d)))



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

left = 0
right = n - 1
ans = 0

for i in range(n):
    left = 0
    right = n - 1
    while left <= right:
        if i == left == right:
            left, right = left + 1, right - 1
            continue

        elif i == left:
            if a[i] % a[right] == 0:
                break

        elif i == right:
            if a[i] % a[left] == 0:
                break

        else:
            if a[i] % a[left] == 0 or a[i] % a[right] == 0:
                break

        left, right = left + 1, right - 1

    if left > right:
        ans += 1

print(ans)


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

ans = 0
dp = [0] * (a[-1] + 1)

for i in range(n):
    tmp = a[i]
    while tmp <= a[-1]:
        dp[tmp] += 1
        tmp += a[i]

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

print(ans)
# Original solution
import functools

def f(l, d):
    le = len(l)
    if le == 0:
        return []
    elif le == 1:
        if l[0] % d == 0:
            return []
        return l

    m = functools.reduce(lambda x, y: x*y, l)
    if m % d != 0:
        return l

    h = le//2
    return f(l[:h], d) + f(l[h:], d)


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

a.sort(key=lambda x: -x)
i = 0
p = []
while len(a) != 0:
    i = a.pop()
    if i in a:
        a.pop()
        while i in a:
            a.pop()
        continue
    p.append(i)

    a = f(a, i)

print((len(p)))

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

a.sort()
mx = a[-1]

dp = [True for _ in range(mx)]

cnt = 0
for i, ai in enumerate(a):
    if dp[ai-1]:
        if i >= len(a)-1 or ai != a[i+1]:
            cnt += 1
        for j in range(ai - 1, mx, ai):
            dp[j] = False

print(cnt)