CodeEff/ECCO huggingface dataset:
# Original solution
# D - Not Divisible
from collections import Counter

N = int(eval(input()))
A = list(int(a) for a in input().split())
c = Counter(A)
ng = set([i[0] for i in list(c.items()) if i[1] >= 2])
A.sort()

M = max(A)
primes = []
is_prime = [True] * (M+1)
for i, a in enumerate(A):
    if is_prime[a]:
        if a not in ng:
            primes.append(a)
        for j in range(a*2, M+1, a):
            is_prime[j] = False
print((len(primes)))



# Optimized solution
# D - Not Divisible

N = int(eval(input()))
A = list(int(a) for a in input().split())
A.sort()

M = max(A)
is_D = [0] * (M+1)
for i, a in enumerate(A):
    if is_D[a]:
        is_D[a] = 2
        continue
    for j in range(a, M+1, a):
        is_D[j] += 1

ans = 0
for a in A:
    if is_D[a] == 1:
        ans += 1
print(ans)
# Original solution
N = int(eval(input()))
arr = sorted(list(map(int, input().split())))
ans_list = []
chohuku = [x for x in set(arr) if arr.count(x) > 1]
count_arr = [0]*arr[-1]

ans = 0
for i in arr:
    if count_arr[i-1] == 0:
        ans += 1
        ans_list.append(i)
    for j in range(1,(arr[-1]//i)+1):
        count_arr[(i*j)-1] += 1

for i in ans_list:
    if i in chohuku:
        ans -= 1

print(ans)

# Optimized solution
N = int(eval(input()))
arr = sorted(list(map(int, input().split())))
count_arr = [0]*arr[-1]

ans = 0
for i in arr:
    for j in range(1,(arr[-1]//i)+1):
        count_arr[(i*j)-1] += 1
for i in arr:
    if count_arr[i-1] == 1:
        ans +=1

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

a_sorted = sorted(a)
divisible_list = [True] * n

for i in range(n-1):
    if not divisible_list[i]:
        continue
    for j in range(i+1, n):
        if a_sorted[j] == a_sorted[i]:
            divisible_list[i] = False
            tmp = j
            while True:
                if tmp < n and a_sorted[tmp] == a_sorted[i]:
                    divisible_list[j] = False
                    tmp += 1
                else:
                    break

        elif a_sorted[j] % a_sorted[i] == 0:
            divisible_list[j] = False
print((sum(divisible_list)))

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

a_sorted = sorted(a)
divisible_list = [0] * (max(a)+1)

for i in range(len(a)):
    for j in range(0, len(divisible_list), a[i]):
        divisible_list[j] += 1

ans = 0
for i in range(len(a)):
    if divisible_list[a[i]] == 1:
        ans+=1
print(ans)
# Original solution
import sys

N = int(eval(input()))

argv = input().split()
divisible = 0
count = 0
  
for i in range(N):
  divisible = 0
  for j in range(N):
    if i == j:
      continue
    elif (int(argv[i]) % int(argv[j])) == 0:
      divisible = 1
      break
      
  if divisible == 0:
    count += 1
    
print(count)

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

intList = list(map(int, input().split()))
intList.sort()

cntList = [1] * (intList[-1] + 1)

i = 0
j = 1
ans = 0

while i < (N - 1):
  base = intList[i]
  j = 1
  num = base
  if cntList[num] == 1:
    while num <= intList[-1]:
      if cntList[num] == 1:
        cntList[num] = 0
      j += 1
      num = base * j
    if intList[i] != intList[i+1]:
      ans += 1
  i += 1

if cntList[intList[-1]] == 1:
  ans += 1
  
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
b = set(i for i in range(n))
ans = [0]*n
warizai_index = set()

for i in range(n):
    for wari in warizai_index:
        if a[i]%a[wari] == 0 and i != wari:
            ans[i] = 1
            if i in warizai_index:
                warizai_index.remove(i)
            break
    if ans[i] == 1:
        continue
    
    #for j in b:
    for j in range(n):
        if i == j:
            continue
        if a[i]%a[j] == 0:
            ans[i] = 1
            if i in warizai_index:
                warizai_index.remove(i)
            warizai_index.add(j)
            break

print((ans.count(0)))

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

for i in range(n-1):
    p = a[i]
    if dp[p] == 1:
        for j in range(aMax//p+1):
            dp[p*j] = 0
        if a[i] != a[i+1]:
            ans += 1
if dp[aMax] == 1:
    ans += 1
print(ans)
# Original solution
from collections import Counter


def is_divideable(a, nums):
    x = 1
    while x ** 2 <= a:
        if a % x == 0:
            if x in nums or (a // x) in nums:
                return True
        x += 1
    return False


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    cnt = Counter(A)
    nums = set()
    A.sort()
    ans = 0
    for a in A:
        if cnt[a] == 1 and not is_divideable(a, nums):
            ans += 1
        nums.add(a)
    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
from collections import Counter


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    MAX = max(A)
    dp = [True] * (MAX+1)
    A.sort()
    cnt = Counter(A)
    ans = 0
    for a in A:
        if dp[a]:
            if cnt[a] == 1:
                ans += 1
            x = a
            while x <= MAX:
                dp[x] = False
                x += a
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(eval(input()))
n = I()
A = sorted(readInts())
dic = defaultdict(int)
cnt = 0

# ------------
is_prime = [True] * (10**6+1)
#print('a')
for i in range(n):
    #ll += 1
    #print(i)
    if is_prime[A[i]] == True:
        for j in range(2*A[i], 10**6+1,A[i]):
            is_prime[j] = False # その素数の倍数のやつ

 # -----------
for i in A:
    dic[i] += 1
cnt = 0
if A[0] == 1:
    if dic[1] >= 2:
        print((0))
        exit()
    else:    
        print((1))
        exit()
for a in A:
    if is_prime[a] and not dic[a] >= 2:
        #print(a)
        cnt += 1
print(cnt)


# Optimized solution
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(eval(input()))
n = I()
A = sorted(readInts())
dic = defaultdict(int)
cnt = 0
for i in A:
   dic[i] += 1
A = list(set(A))
# ------------
is_prime = [True] * (10**6+1)
#print('a')
for i in range(len(A)):
    #ll += 1
    #print(i)
    #print(A[i])
    if is_prime[A[i]] == True:
        for j in range(2*A[i], 10**6+1,A[i]):
            is_prime[j] = False # その素数の倍数のやつ

 # -----------
cnt = 0
if A[0] == 1:
    if dic[1] >= 2:
        print((0))
        exit()
    else:
        print((1))
        exit()
for a in A:
    if is_prime[a] and not dic[a] >= 2:
        #print(a)
        cnt += 1
print(cnt)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
flag = [True] * n
for i in range(n):
    if not flag[i]: continue
    for j in range(i + 1, n):
        if a[j] % a[i] == 0:
            flag[j] = False
            if a[i] == a[j]:
                flag[i] = False
print((flag.count(True)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1] + 1)
memo = -1
for i in a:
    if memo == i:
        flag[i] = False
        continue
    memo = i
    tmp = 2 * i
    while tmp <= a[-1]:
        flag[tmp] = False
        tmp += i
ans = 0
for i in a:
    if flag[i]: ans += 1
print(ans)
# Original solution
import collections

n=int(eval(input()))
arr=list(map(int,input().split()))
arr=sorted(arr)
s=set()
cnt=collections.Counter(arr)
for i in range(n):
  if arr[i] in s:
    continue
  for j in range(2,10**6//arr[i]+1):
    s.add(arr[i]*j)
ans=0
for i in range(n):
  if arr[i] in s:
    continue
  if cnt[arr[i]]>=2:
    continue
  ans+=1
print(ans)

# Optimized solution
import collections

n=int(eval(input()))
arr=list(map(int,input().split()))
arr=sorted(arr)
s=set()
cnt=collections.Counter(arr)
for i in range(n):
  if arr[i] in s:
    continue
  if cnt[arr[i]]>=2:
    s.add(arr[i])
  for j in range(2,10**6//arr[i]+1):
    s.add(arr[i]*j)
ans=0
for i in range(n):
  if arr[i] in s:
    continue
  if cnt[arr[i]]>=2:
    continue
  ans+=1
print(ans)
# Original solution
# coding:utf-8
n = int(eval(input()))
a = list(map(int, input().split()))
count = [0 for _ in range(max(a) + 1)]
ans = 0

for i in a:
    if count[i] != 0:
        count[i] = 1
        continue
    for j in range(2 * i, max(a) + 1, i):
        count[j] = 1
    count[i] = 2

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

print(ans)


# Optimized solution
# coding:utf-8
n = int(eval(input()))
a = list(map(int, input().split()))
m = max(a)
count = [0 for _ in range(m + 1)]
ans = 0

for i in a:
    if count[i] != 0:
        count[i] = 1
        continue
    for j in range(2 * i, m + 1, i):
        count[j] = 1
    count[i] = 2

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

print(ans)
# Original solution
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
    a = [int(i) for i in ipt().split()]
    al = [0]*(max(a)+1)
    a.sort()
    ans = 0
    pi = 0
    for i in a:
        if al[i] == 0:
            ans += 1
            na = i
            while na <= max(a):
                al[na] = 1
                na += i
            pi = i
        else:
            if i == pi:
                ans -= 1
                pi = 0


    print(ans)

    return

if __name__ == '__main__':
    main()


# Optimized solution
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
    a = [int(i) for i in ipt().split()]
    a.sort()
    ma = max(a)+1
    al = [True]*ma
    ans = 0
    pi = 0
    for i in a:
        if al[i]:
            ans += 1
            for j in range(i,ma,i):
                al[j] = False
            pi = i
        else:
            if i == pi:
                ans -= 1
                pi = 0

    print(ans)

    return

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

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[:-1]
  
import collections

if n == 1:
  print((1))
else:
  total = 0
  ss = set(al)
  c = collections.Counter(al)
  for num in al:
    if c[num] >= 2:
      continue
    for d in make_divisors(num):
      if d in ss:
        break
    else:
      total += 1
  print(total)



# Optimized solution
n = int(eval(input()))
al = [int(i) for i in input().split()]  
al.sort()
ma = al[-1]
from collections import Counter
c = Counter(al)

if n == 1:
  print((1))
else:
  sn = set()
  total = 0
  l = len(al)
  for num in al:
    if num in sn:
      continue
    if c[num] == 1:
      total += 1
    tmp = num
    while tmp <= ma:
      sn.add(tmp)
      tmp += num
  print(total)
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))

dic={}
for i in range(N):
    if A[i] not in dic:
        dic[A[i]]=1
    else:
        dic[A[i]]+=1

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

if 1 in dic:
    if dic[1]>1:
        print((0))
        exit()
    else:
        print((1))
        exit()

def make_divisors(n):
    divisors=[]
    for j in range(2, int(n**0.5)+1):
        if n%j==0:
            divisors.append(j)
            if j!=n//j:
                divisors.append(n//j)
 
    return divisors

ans=0
for i in range(N):
    if dic[A[i]]>1:
        continue
    f=False
    for j in range(2, int(A[i]**0.5)+1):
        if A[i]%j==0:
            if j in dic or A[i]//j in dic:
                f=True
                break
    if f:
        continue
    ans+=1

print(ans)

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

M=max(A)
check=[0]*(M+1)
for i in range(N):
    a=A[i]
    while a<=M:
        check[a]+=1
        a+=A[i]
ans=0
for i in range(N):
    if check[A[i]]==1:
        ans+=1

print(ans)
# Original solution
n = int(eval(input()))
a = sorted(list(map(int, input().split())))[::-1]

ans = 0
while(len(a)):
    a_min = a.pop()
    if len(a) == 0:
        ans += 1
        break
    if a_min == a[-1]:
       ans -= 1 
    a = [el for el in a if el % a_min != 0]
    ans += 1
    
print(ans)

# Optimized solution
n = int(eval(input()))
a = sorted(list(map(int, input().split())))
max_a = a[-1]

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

total = 0
for i in q:
    if i == 1:
        total += 1
print(total)
# Original solution
n = int(eval(input()))
A = list(map(int,input().split()))
A.sort()

ac = A.count(1)
if ac == 1:
    print((1))
    exit()
if ac >= 2:
    print((0))
    exit()

num = [0]*1000005
for a in A:
    num[a] += 1

b = [False]*1000005
seen = [False]*1000005
cnt = 0
A = list(set(A))
A.sort()
for a in A:
    if seen[a]:
        continue

    seen[a] = True
    if b[a] == False:
        cnt += 1
        if num[a] > 1:
            cnt -= 1

    for i in range(a, 1000005, a):
        b[i] = True
print(cnt)


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

num = [0]*(10**6+1)
for a in A:
    num[a] += 1

bai = [False]*(10**6+1)
cnt = 0
A = list(set(A))
A.sort()
for a in A:
    if bai[a]:
        continue

    if num[a] == 1:
        cnt += 1

    for i in range(a, 10**6+1, a):
        bai[i] = True
print(cnt)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
if(len(a) == 1):
    print((1))
else:
    a.sort()
    flug = 1
    for j in range(n):
        numl = []
        if(j >= len(a)):
            break
        else:
            flug = 1
            for i in range(j+1, len(a)):
                if(a[i] == a[j] and flug == 1):
                    numl.append(j)
                    flug = 0
                    numl.append(i)
                elif(a[i] % a[j]==0):
                    numl.append(i)
            for i in range(len(numl)):
                a.pop(numl[-(i+1)])
    print((len(a)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
result=0
flug = 0
if(len(a) == 1):
    print((1))
else:
    a.sort()
    dp = [True] * a[-1]
    flug = 1
    for j in range(n):
        if(dp[a[j]-1] == True):
            if(a[j] == a[j-1]):
                if(flug == 0):
                    result-=1
                    flug = 1
            else:
                result+=1
                flug = 0
            k = a[j] * 2
            while(k-1 < len(dp)):
                dp[k-1] = False
                k+=a[j]
                
    print(result)
# Original solution
n = int(eval(input()))
lst = [int(i) for i in input().split()]
lst.sort()
#print(lst)

if 1 in lst:
  count = 0
  for i in range(n):
    if lst[i] == 1:
      count += 1
    if count == 2:
      break
  if count == 1:
    print((1))
  else:
    print((0))
else:
  tf_lst = [1] * lst[n - 1]
  count = 0
  if n > 1:
    pre = 0
    for i in range(n):
      tf_lst[pre:lst[i] - 1] = [0] * (lst[i] - pre - 1)
      pre = lst[i]
      if tf_lst[lst[i] - 1] == 0:
        continue
      if i <= n - 2:
        if lst[i] == lst[i + 1]:
          tf_lst[lst[i] - 1] = 0
      if n > 100:
        if lst[i] >= lst[n - 1] ** 0.5:
          continue
      for j in range(lst[i] * 2, lst[n - 1] + 1, lst[i]):
        if j in lst:
          tf_lst[j - 1] = 0
    #print(tf_lst)
    for i in tf_lst:
      count += i
  else:
    count += 1
  print(count)


# Optimized solution
n = int(eval(input()))
lst = [int(i) for i in input().split()]
lst.sort()
#print(lst)

if 1 in lst:
  count = 0
  for i in range(n):
    if lst[i] == 1:
      count += 1
    if count == 2:
      break
  if count == 1:
    print((1))
  else:
    print((0))
else:
  tf_lst = [1] * lst[n - 1]
  count = 0
  if n > 1:
    pre = 0
    for i in range(n):
      tf_lst[pre:lst[i] - 1] = [0] * (lst[i] - pre - 1)
      pre = lst[i]
      if tf_lst[lst[i] - 1] == 0:
        continue
      if i <= n - 2:
        if lst[i] == lst[i + 1]:
          tf_lst[lst[i] - 1] = 0
      for j in range(lst[i] * 2, lst[n - 1] + 1, lst[i]):
        tf_lst[j - 1] = 0
    #print(tf_lst)
    for i in tf_lst:
      count += i
  else:
    count += 1
  print(count)
# Original solution
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)

def main():
    n=int(input().rstrip())
    a=sorted([int(i) for i in input().split()])
    maxn=10**6+1
    dp=[True]*(maxn)
    cnt=[0]*(maxn)
    ans=0
    for i in a:
        if dp[i]:
            cnt[i]+=1
            for j in range(i*2,maxn,i):
                dp[j]=False

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

if __name__=="__main__":main()

# Optimized solution
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)

N=int(input().rstrip())
a=[int(i) for i in input().split()]
l=max(a)+1
cnt=[0]*l
for i in a:
    for j in range(i,l,i):cnt[j]+=1

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

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(reverse=True)
    return divisors

def main():
    D = {}
    for i in range(n):
        if A[i] not in D:
            D[A[i]] = 1
        else:
            D[A[i]] += 1
    ans = 0
    for i in range(n):
        d = make_divisors(A[i])
        for x in d:
            if x != A[i]:
                if x in D:
                    break
            else:
                if D[x] >= 2:
                    break
        else:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()


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

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(reverse=True)
    return divisors

def main():
    A.sort()
    S = set(A)
    m = max(A)
    X = [0]*(m+1)
    for i in range(1, m+1):
        j = i
        if j not in S:
            continue
        while j <= m:
            X[j] += 1
            j += i
    #print(X)

    D = {}
    for i in range(n):
        if A[i] not in D:
            D[A[i]] = 1
        else:
            D[A[i]] += 1

    ans = 0
    for a in A:
        if X[a] == 1 and D[a] == 1:
            ans += 1
    print(ans)

    #for i in range(m+1):
    #    if X[i] == 1:
            #print(i)

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

from collections import Counter
C = Counter(A)

X = [0]*(10**6+1)
A.sort()
ans = 0
for a in A:
    if X[a] == 0 and C[a] == 1:
        ans += 1
    X[a] += 1
    j = 2*a
    while j <= 10**6:
        X[j] += 1
        j += a
print(ans)


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

from collections import Counter
C = Counter(A)

X = [0]*(10**6+1)
A = list(set(A))
A.sort()
ans = 0
for a in A:
    if X[a] == 0 and C[a] == 1:
        ans += 1
    X[a] += 1
    j = 2*a
    while j <= 10**6:
        X[j] += 1
        j += a
print(ans)
# Original solution
import sys
from collections import deque
import copy
def main():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    A.sort()
    MAX = (10 ** 6) + 5
    prime = [True] * MAX
    ans = 0
    for i in range(1, N):
        if A[i] == A[i - 1]:
            prime[A[i]] = False
            for j in range(A[i] * 2, MAX, A[i]):
                prime[j] = False
    for i in range(N):
        now = A[i]
        if prime[now]:
            ans += 1
            for j in range(now * 2, MAX, now):
                prime[j] = False
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys
from collections import deque
import copy
def main():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    A.sort()
    MAX = (10 ** 6) + 5
    prime = [True] * MAX
    ans = 0
    for i in range(1, N):
        if A[i] == A[i - 1] and prime[A[i]]:
            prime[A[i]] = False
            for j in range(A[i] * 2, MAX, A[i]):
                prime[j] = False
    for i in range(N):
        now = A[i]
        if prime[now]:
            ans += 1
            for j in range(now * 2, MAX, now):
                prime[j] = False
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
n=int(eval(input()))
a=list(map(int,input().split()))
l=[[0 for _ in range(n)] for _ in range(n)]

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

cnt=0
for i in range(n):
    if 1 not in l[i]:
        cnt+=1
print(cnt)


# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
l=[0 for _ in range(n)]

a.sort()

for i in range(n):
    for j in range(n):
        if a.count(a[i])>=2:
            l[i]=1
            break
        if ((a[i]//2)<a[j]):
            break
        if a[i]%a[j]==0:
            l[i]=1
            break

cnt=l.count(0)
print(cnt)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

ans = 0
for i in range(n):
  for j in sorted(a):
    if a[i] % j == 0:
      if a[i] != j:
        ans += 1
        break
      else:
        if a.count(j) > 1:
          ans += 1
          break
    
print((n - ans))

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

m = max(A)+1
dp = [1]*m
for a in A:
  if dp[a-1] == 1:
    dp[a-1] = 2
    for i in range(a*2, m, a):
      dp[i-1] = 0
  elif dp[a-1] == 2:
    dp[a-1] = 0
print((sum([1 for a in A if dp[a-1]])))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))
L = [0] * (10 ** 6 + 1)
S = set()

for a in A:
    if a in S:
        L[a] = 1
    S.add(a)
    for i in range(2, 10 ** 6 + 1):
        if a * i > 10 ** 6:
            break
        L[a * i] = 1

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

print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
A.sort()
L = [0] * (10 ** 6 + 1)
S = set()

for a in A:
    if L[a]:
        continue
    if a in S:
        L[a] = 1
    S.add(a)
    for i in range(2, 10 ** 6 + 1):
        if a * i > 10 ** 6:
            break
        L[a * i] = 1

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

print(ans)