CodeEff/ECCO huggingface dataset:
# Original solution
import math

n = int(eval(input()))

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

ans = 0
d = {}

for i in range(len(a)):
    if a[i] in list(d.keys()):
        d[a[i]] += 1
    else:
        d[a[i]] = 1
# print(d)

for i in range(len(a)):
    flag = False


    if d[a[i]] > 1:
        continue

    if a[i] != 1 and 1 in list(d.keys()):
        continue
    # print("a: ", a[i])
    j = 2
    while j <= math.sqrt(a[i]):
        if a[i] % j == 0:
            # print(j)
            if a[i] / j == j:
                if j in list(d.keys()):
                    flag = True
                    break
            else:
                if j in list(d.keys()) or (a[i]/j) in list(d.keys()):
                    flag = True
                    break
    
        j += 1
    
    if flag == False:
        ans += 1

print(ans)

# Optimized solution
n = int(eval(input()))

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

ans = 0
d = {}


for i in range(len(a)):
    if a[i] in list(d.keys()):
        d[a[i]] += 1
    else:
        d[a[i]] = 1
max_ = max(a)
arr = [True] * (max_+1) 
ans = 0

for i in range(1, max_+1):
    if i in list(d.keys()) and arr[i]:
        temp = i
        # print("i: ", i)
        while (temp + i) <= (max_):
            # print(temp+i)
            arr[(temp+i)] = False

            temp += i

        if d[i] == 1:
            ans += 1
# print(arr)
print(ans)
# Original solution
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)

# Optimized solution
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)
# Original solution
import math
def isPrime(n):
  if n == 1:
    return False
  for k in range(2, int(math.sqrt(n)) + 1):
    if n % k == 0:
      return False
  return True

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

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

if A[0] == 1 and A[1] == 1:
  print((0))
  exit()
if A[0] == 1 and A[1] != 1:
  print((1))
  exit()

for i in range(N):
  x = A[i]
  if isPrime(x):
    if i - 1 >= 0 and x == A[i - 1]:
        cnt -= 1
        continue
    if i + 1 < N and x == A[i + 1]:
        cnt -= 1
        continue
    continue
    
  for j in range(min(i + 2, N)):
    if i == j:
      continue
    y = A[j]
    if x % y == 0:
      cnt -= 1
      break
print(cnt)


# Optimized solution
N = int(eval(input()))
A = sorted(list(map(int, input().split())))
m = A[-1]
B = [0] * m
for a in A:
  B[a - 1] += 1
  if B[a - 1] == 1:
    for j in range(a * 2, m + 1, a):
      B[j - 1] = 2
print((B.count(1)))
# Original solution
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    ans = 0
    for i in a:
        cnt = 0
        for j in range(n):
            if i % a[j] == 0:
                cnt += 1
        if cnt == 1:
            ans += 1
    print(ans)
    
if __name__ == '__main__':
    main()

# Optimized solution
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    a_s = sorted(a)
    a_set = set(a_s)
    maxv = max(a)
    res = [0] * maxv
    rep = 0
    for i in a_s:
        if i in a_set:
            if res[i-1] == 0:
                for j in range(i, maxv+1, i):
                    res[j-1] += 1
            else:
                res[i-1] +=1
    cnt = 0
    for i in range(n):
        if res[a[i]-1] == 1:
            cnt += res[a[i]-1]
    print(cnt)

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

count=0
for i in range(N):
    flag=True
    for j in range(N):
        if i!=j and A[i]%A[j]==0:
            flag=False
    if flag==True:
        count+=1
        
print(count)

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

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

for a in A:
    for x in range(a,len(dp),a):
        dp[x]+=1

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

print(count)
# Original solution
import collections
# Your code her
a = int(eval(input()))
b = [int(s) for s in input().split()]
b = sorted(b)
mod = int(1000000)
d = {}
e = collections.Counter(b)
X = int(0)
ans = int(0)

for i in range(a):
    if d.get(b[i]) == None:
        X = b[i]
        while X <= (mod-b[i]):
            X += b[i]
            d[X] = 1
        X = 0
    else:
        pass

for i in range(a):
    if e.get(b[i]) == 1:
        if d.get(b[i]) == None:
            ans += 1

print(ans)

# Optimized solution
import collections
# Your code her
a = int(eval(input()))
b = [int(s) for s in input().split()]
b = sorted(b)
mod = int(1000000)
d = {}
e = collections.Counter(b)
X = int(0)
ans = int(0)

for i in range(a):
    if d.get(b[i]) == None:
        if e.get(b[i]) != 1:
            d[b[i]] = 1
        X = b[i]
        while X <= (mod-b[i]):
            X += b[i]
            d[X] = 1
        X = 0
    else:
        pass

for i in range(a):
    if d.get(b[i]) == None:
        ans += 1

print(ans)
# Original solution
N = int(eval(input()))
A = [int(i) for i in input().split()]
from collections import defaultdict
cnt_A = defaultdict(int)
for a in A:
    cnt_A[a] += 1
NG_list = []
for key in list(cnt_A.keys()):
    if cnt_A[key] >= 2:
        NG_list.append(key)
NG_list = set(NG_list)
sort_A = sorted(A)
from collections import deque
Q = deque(sort_A)
ans = 0
while Q:
    M = Q.popleft()
    if M not in NG_list:
        ans += 1
    R = deque([])
    while Q:
        q = Q.popleft()
        if q%M != 0:
            R.append(q)
    Q = R
print(ans)

# Optimized solution
n = int(eval(input()))
a = [int(i) for i in input().split()]
max_a = max(a)
cnt_d = [0] * (max_a + 1)
for ai in a:
    for multi in range(ai, max_a + 1, ai):
        cnt_d[multi] += 1
print((sum(cnt_d[ai] == 1 for ai in a)))
# Original solution
n = int(eval(input()))
A = list(map(int, input().split()))
A=sorted(A)

table=[0]*(10**6+1)
for i in range(n):
    table[A[i]]+=1

for i in range(n):
    if A[i]>0:
        j=2
        while A[i]*j<10**6+1:
            if table[A[i]*j]>0:
                table[A[i]*j]=-1
            j+=1

cnt=0
for x in table:
    if x==1:
        cnt+=1
print(cnt)

# Optimized solution
n = int(eval(input()))
A = list(map(int, input().split()))
A=sorted(A)
up=max(A)
table=[0]*(up+1)
for i in range(n):
    table[A[i]]+=1
aset=set(A)

for i in range(len(aset)):
    if table[A[i]]>0:
        j=2
        while A[i]*j<up+1:
            if table[A[i]*j]>0:
                table[A[i]*j]=-1
            j+=1

cnt=0
for x in table:
    if x==1:
        cnt+=1
print(cnt)
# Original solution
N = int(eval(input()))
A = [int(hoge) for hoge in input().split()]
A.sort()
dp = [False] * (max(A) + 1)
ans = 0
prev = -1
for a in A:
    if dp[a] == False:
        for j in range(2,1 + (max(A) // a)):
            dp[a*j] = True
        if a != prev:
            ans += 1
        else:
            dp[a] = True
            ans -= 1
    prev = a
print(ans)

# Optimized solution
N = int(eval(input()))
A = [int(hoge) for hoge in input().split()]
A.sort()
M = max(A)
dp = [False] * (M+ 1)
ans = 0
prev = -1
for a in A:
    if dp[a] == False:
        for j in range(2,1 + (M// a)):
            dp[a*j] = True
        if a != prev:
            ans += 1
        else:
            dp[a] = True
            ans -= 1
    prev = a
print(ans)
# Original solution
N = int(eval(input()))
A_list = list(map(int, input().split()))
M = 10**6+1
cnt = [0 for _ in range(M)]

for i in A_list:
    if cnt[i] != 0:
        cnt[i] = 2
        continue
    for j in range(i, M, i): cnt[j] += 1

ans = 0
for k in A_list:
    if cnt[k] == 1: ans += 1
print(ans)

# Optimized solution
N = int(eval(input()))
A_list = list(map(int, input().split()))
M = max(A_list)+1
cnt = [0 for _ in range(M)]

for i in A_list:
    if cnt[i] != 0:
        cnt[i] = 2
        continue
    for j in range(i, M, i): cnt[j] += 1

ans = 0
for k in A_list:
    if cnt[k] == 1: ans += 1
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ans = 0

while len(a) >= 1:
  ans += 1
  temp=a.pop(0)
  if len(a) >= 1:
    if a[0] == temp:
      ans -= 1
    a = list([x for x in a if x % temp != 0])
  
print(ans)

# Optimized solution
n = int(eval(input()))
a  = list(map(int, input().split()))
a.sort()
dp = [0]*a[n-1]
ans = 0
temp2 = 0
for i in range(n):
  if temp2 == a[i]:
    ans -= 1
    temp2=0
  if dp[a[i]-1] == 0:
    ans += 1
    temp = a[i]
    temp2 = a[i]
    while temp <= a[n-1]:
      dp[temp-1] = 1
      temp = temp+a[i]
  #print(dp)    
print(ans)
# Original solution
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))
def ZIP(n): return list(zip(*(MAP() for _ in range(n))))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

def primes_for(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n + 1):
        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]]

ans = 0
lim = 10**6+1
ok = [True]*lim

for a in sorted(A):
    for j in range(a*2, lim, a):
        ok[j] = False

cnt = Counter(A)
for a in A:
    if cnt[a] == 1 and ok[a]:
        ans += 1
print(ans)


# Optimized solution
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))
def ZIP(n): return list(zip(*(MAP() for _ in range(n))))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

ans = 0
lim = max(A)+1
ok = [True]*lim
checked = [False]*lim

for a in sorted(A):
    if (not checked[a]) and ok[a]:
        checked[a] = True
        for j in range(a*2, lim, a):
            ok[j] = False

cnt = Counter(A)
for a in A:
    if cnt[a] == 1 and ok[a]:
        ans += 1
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
ans = [0]*(max(A) + 5)
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max(A) + 5, i):
      ans[j] = 2
print((ans.count(1)))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
max_A = A[-1] + 1
ans = [0]*max_A
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max_A, i):
      ans[j] = 2
print((ans.count(1)))
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
t = []
for i in range(1000):
    t.append([])
for i in range(n):
    j = a[i]//1024
    t[j].append(a[i])
#print(t)
p = n
for i in range(len(t[0])):
    for j in range(len(t[0])):
        if(i != j):
            if(t[0][i] % t[0][j] == 0):
                p -= 1
                #print(t[0][i],t[0][j])
                break
for i in range(1,1000):
    for j in range(len(t[i])):
        x = 0
        for k in range(len(t[i])):
            if(j != k):
                if(t[i][j] ==  t[i][k]):
                    p -= 1
                    #print(t[i][j],t[i][k],-1)
                    x = 1
                    break
        if(x == 0):
            for k in range((i+2)//2):
                for l in range(len(t[k])):
                    if(t[i][j] % t[k][l] == 0):
                        p -= 1
                        #print(t[i][j],t[k][l])
                        x = 1
                        break
                if(x == 1):
                    break

print(p)

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
m = max(a)
t = [1]*(m+1)
for i in range(n):
    if(t[a[i]] == 1):
        x = a[i]*2
        while(x <= m):
            t[x] = 0
            x += a[i]
for i in range(n):
    if(t[a[i]] == 0):
        n -= 1
    elif(t[a[i]] == 1):
        t[a[i]] = -1
    elif(t[a[i]] == -1):
        t[a[i]] = -2
        n -= 2
    else:
        n -= 1
print(n)
# Original solution
N = int(eval(input()))
Alist = list(map(int,input().split(" ")))
ansList = list(range(N))
count = 0
for i in range(N):
    flag = False
    for j in range(N):
        if i != j:
            if (Alist[i]%Alist[j]==0):
                flag = True
    if flag==False:
        count+=1


print(count)

# Optimized solution
N = int(eval(input()))
Alist = list(map(int,input().split(" ")))
Alist.sort()
Amax = Alist[-1]
dp = [1]*(Amax+1)
count = 0
for i in range(len(Alist)-1):
    p = Alist[i]
    if dp[p] == 1:
        for j in range(Amax//p+1):
            dp[p*j] = 0
        if Alist[i] != Alist[i+1]:
            count+=1
if dp[Amax] == 1:
    count += 1
print(count)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
countList = [0]*(10**6 + 1)
answer = 0

# Aにnがm個あるときcountList[n] = m
for i in A:
  countList[i] += 1

for j in range(10**6 + 1):
  # Aにjが含まれていれば、jの倍数をすべてcountListから除外
  # jの倍数pはjで割り切れるので除外可能
  # pの倍数qはjでも割り切れるのでjの時の処理によって除外される
  if countList[j] > 0:
    for k in range(2 * j, 10**6 + 1, j):
      countList[k] = 0
  # jが2個以上ある場合にはそれを正解としてカウントしない
  if countList[j] == 1:
      answer += 1

print(answer)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
minNum = A[0]
maxNum = A[N - 1]
countList = [0]*(10**6 + 1)
answer = 0

# Aにnがm個あるときcountList[n] = m
for i in A:
  countList[i] += 1

for j in range(minNum, maxNum + 1):
  # Aにjが含まれていれば、jの倍数をすべてcountListから除外
  # jの倍数pはjで割り切れるので除外可能
  # pの倍数qはjでも割り切れるのでjの時の処理によって除外される
  if countList[j] > 0:
    for k in range(2 * j, 10**6 + 1, j):
      countList[k] = 0
  # jが2個以上ある場合にはそれを正解としてカウントしない
  if countList[j] == 1:
      answer += 1

print(answer)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
minNum = A[0]
maxNum = A[N - 1]
countList = [0]*(10**6 + 1)
answer = 0

# Aにnがm個あるときcountList[n] = m
for i in A:
  countList[i] += 1

for j in range(minNum, maxNum + 1):
  # Aにjが含まれていれば、jの倍数をすべてcountListから除外
  # jの倍数pはjで割り切れるので除外可能
  # pの倍数qはjでも割り切れるのでjの時の処理によって除外される
  if countList[j] > 0:
    for k in range(2 * j, 10**6 + 1, j):
      countList[k] = 0
  # jが2個以上ある場合にはそれを正解としてカウントしない
  if countList[j] == 1:
      answer += 1

print(answer)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
minNum = A[0]
maxNum = A[N - 1]
countList = [0]*(10**6 + 1)
answer = 0

# Aにnがm個あるときcountList[n] = m
for i in A:
  countList[i] += 1

for j in range(minNum, maxNum + 1):
  # Aにjが含まれていれば、jの倍数をすべてcountListから除外
  # jの倍数pはjで割り切れるので除外可能
  # pの倍数qはjでも割り切れるのでjの時の処理によって除外される
  if countList[j] > 0:
    for k in range(2 * j, maxNum + 1, j):
      countList[k] = 0
  # jが2個以上ある場合にはそれを正解としてカウントしない
  if countList[j] == 1:
      answer += 1

print(answer)
# Original solution
from sys import stdin
input = stdin.readline

n = int(eval(input()))
a = [int(x) for x in input().split()]
b = [0] * 1000001

for x in a:
    for y in range(x, 1000001, x):
        b[y] += 1

cnt = 0

for x in a:
    if b[x] == 1:
        cnt += 1

print(cnt)

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

n = int(eval(input()))
a = [int(x) for x in input().split()]
b = [0] * 1000001
chk = [0] * 1000001
s = set(a)

for x in a:
    chk[x] += 1

for x in s:
    for y in range(x, 1000001, x):
        b[y] += 1

cnt = 0

for x in s:
    if b[x] == 1 and chk[x] == 1:
        cnt += 1

print(cnt)
# Original solution
from collections import Counter

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

c = Counter(a)
p = [True] * (10 ** 6 + 1)
s = list(set(a))

for x in s:
    t = x * 2
    while t <= 10 ** 6:
        p[t] = False
        t += x

ans = 0
for x in a:
    if c[x] == 1 and p[x] == True:
        ans += 1

print(ans)

# Optimized solution
#Ai/Aj not integer
#5
#24 11 8 3 16
#のときは、24は8,3があるからダメ　16も8があるからダメ
N=int(eval(input()))
A=[int(i) for i in input().split()]
D=set()
S=set()
for i in range(N):
    if A[i] in S:
        D.add(A[i])
    else:
        S.add(A[i])
M=max(S)
X=[1 for i in range(M+1)]
for a in S:
    if a in D:
        X[a]=0
    for i in range(2*a,M+1,a):
        X[i]=0
ans=0
for i in range(N):
    if X[A[i]]==1:
        ans+=1
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
num = [0]*(10**6 + 1)
for i in range(n):
    for j in range(1, 10**6//a[i]+1):
        num[a[i]*j] += 1

ans = 0
for i in range(n):
    if num[a[i]] < 2:
        ans += 1

# print(num[:30])
print(ans)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
num = [0]*(10**6+1)
for x in a:
    if num[x] != 0:
        num[x] = 2
        continue
    for i in range(x, 10**6+1, x):
        num[i] += 1

ans = 0
for x in a:
    if num[x] == 1:
        ans += 1

print(ans)
# Original solution
import sys
# x,y = map(int,input().split())
n = int(eval(input()))
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]

for x in a:
    for j in range(x,M,x):
        cnt[j] += 1
    
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]
mx = max(a)+1
for x in a:
    for j in range(x,mx,x):
        cnt[j] += 1
    
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)
# Original solution
from collections import defaultdict

N = int(eval(input()))
a = list(map(int, input().split()))
anstable = [0] * (10 ** 6 + 1)
d = defaultdict(int)
for i in a:
    d[i] += 1

u = []
for i, v in list(d.items()):
    if v == 1:
        u.append(i)

for i in a:
    for j in range(i * 2, 10 ** 6 + 1, i):
        anstable[j] += 1

cnt = 0
for i in u:
    if anstable[i] == 0:
        cnt += 1

print(cnt)

# Optimized solution
from collections import defaultdict

N = int(eval(input()))
a = list(map(int, input().split()))
anstable = [0] * (10 ** 6 + 1)
d = defaultdict(int)
for i in a:
    d[i] += 1

u = []
for i, v in list(d.items()):
    if v == 1:
        u.append(i)
a = set(a)
for i in a:
    for j in range(i * 2, 10 ** 6 + 1, i):
        anstable[j] += 1

cnt = 0
for i in u:
    if anstable[i] == 0:
        cnt += 1

print(cnt)
# Original solution
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    A.sort()
    B = [True]*(10**6+1)

    from collections import Counter
    c = Counter(A)
    bl = set()
    for k, v in list(c.items()):
        if v >= 2:
            bl.add(k)

    ans = 0
    for a in A:
        if a not in bl and B[a]:
            ans += 1
        for i in range(1, 10**6):
            if 10**6 < a*i:
                break
            B[a*i] = False
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    A.sort()
    B = [True]*(10**6+1)

    from collections import Counter
    c = Counter(A)
    bl = set()
    for k, v in list(c.items()):
        if v >= 2:
            bl.add(k)

    ans = 0
    for a in set(A):
        if a not in bl and B[a]:
            ans += 1
        for i in range(1, 10**6):
            if 10**6 < a*i:
                break
            B[a*i] = False
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
def main():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    from collections import Counter
    c = Counter(A)

    for a in set(A):
        v = 2*a
        while v <= 10**6:
            c[v] += 1
            v += a

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

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    B = [0]*(10**6+1)
    for a in A:
        B[a] += 1

    for a in set(A):
        v = 2*a
        while v <= 10**6:
            B[v] += 1
            v += a

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

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
a = [int(x) for x in input().split()]

a.sort()

if n == 1:
    print((1))
    exit()

num = 1
count = 1

for i in range(1,n):
    for j in range(num):
        if i+1 < n and a[i] == a[i+1]:
            count -= 1
            break
        if a[i] % a[j]== 0:
            count -= 1
            break
    num += 1
    count += 1
if a[0] == a[1]:
    count -= 1

print(count)


# Optimized solution
n = int(eval(input()))
a = [int(x) for x in input().split()]

a.sort()

if n == 1:
    print((1))
    exit()

ans = [1] * (a[n-1]+1)

for i in range(n):
    if i >= 1 and a[i] == a[i-1]:
        ans[a[i]] = 0

    else:
        j = 2
        while j*a[i] <= a[n-1]:
            ans[j*a[i]] = 0
            j += 1


sum = 0

for i in range(n):
    sum += ans[a[i]]


print(sum)
# Original solution
#dame datta....
from collections import Counter
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    a = Counter(A)
    l = [0] * (10**6+1)
    for i in A:
        t = 2*i
        while t < 10**6 + 1:
            l[t] = 1
            t += i
    r = 0
    for i in A:
        if l[i] == 0 and a[i] == 1:
            r += 1
    return r
print((main()))


# Optimized solution
#dame datta....
from collections import Counter
def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    B = sorted(A)
    a = Counter(A)
    l = [0] * (10**6+1)
    v = [0] * (10**6+1)
    for i in B:
        if v[i] == 1 or l[i] == 1:
            continue
        else:
            v[i] = 1
        t = 2*i
        while t < 10**6 + 1:
            l[t] = 1
            t += i
    r = 0
    for i in A:
        if l[i] == 0 and a[i] == 1:
            r += 1
    return r
print((main()))
# Original solution
from collections import Counter
import bisect
N = int(eval(input()))
A = list(map(int,input().split()))
cnt = Counter(A)
A.sort()
ans = 0
MX = 10**6
P = [0] * (MX+1)
for a in A:
    if P[a]==0:
        for i in range(MX+1):
            x = a*i
            if x > MX:
                break
            P[x] = 1
        if cnt[a]==1:
            ans+=1
print (ans)

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

    ans = 0
    from collections import Counter
    cnt = Counter(a)
    lim = max(a) + 1
    tmp = [0] * (lim)
    # set_a = list(set(a))
    # set_a.sort()
    a.sort()

    for aa in a:
        if tmp[aa] == 0:
            for j in range(lim):
                if aa * j > lim-1:
                    break
                tmp[aa*j] = 1

            if cnt[aa] == 1:
                # print(aa, ans)
                ans += 1




    print(ans)

if __name__=='__main__':
    main()