CodeEff/ECCO huggingface dataset:
# Original solution
import sys
from collections import defaultdict
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
 
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    dic = defaultdict(int)
    a.sort()
    ans = 0
    for i in range(n):
        x = a[i]
        if i < n-1 and a[i] == a[i+1]:
            dic[a[i]] = 1
            continue
        flag = 1
        for check in range(1,int(x**0.5)+1):
            if(x%check==0):
                if dic[check]:
                    flag = 0
                    break
                if dic[x//check]:
                    flag = 0
                    break
        if flag:
            ans += 1
        dic[a[i]] = 1
    print(ans)
    
if __name__ == "__main__":
    main()

# Optimized solution
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
 
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    a.sort()
    ans = 0
    N = max(a)+1
    tab = [1 for _ in range(N)]
    for i in range(n):
        x = a[i]
        if i < n-1 and a[i] == a[i+1]:
            tab[a[i]] = 0
        if tab[x]:
            ans += 1
        for i in range(N):
            if x*i >= N:
                break
            tab[x*i] = 0        
    print(ans)
    
if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
a_list = list(map(int, input().split()))
ans_len = 10**6+10
is_ans = [0]*(ans_len)

for a in a_list:
    if is_ans[a] == 0:
        b = 2*a
        while b < ans_len:
            is_ans[b] += 1
            b += a

ans = 0
for a in a_list:
    if a_list.count(a) == 1:
        ans += (is_ans[a] == 0)
print(ans)


# Optimized solution
n = int(eval(input()))
a_list = list(map(int, input().split()))
ans_len = 10**6+10
is_ans = [0]*(ans_len)

for a in a_list:
    is_ans[a] += 1
    if is_ans[a] == 1:
        b = 2*a
        while b < ans_len:
            is_ans[b] += 2
            b += a

ans = 0
for a in a_list:
    # print(a, is_ans[a])
    ans += (is_ans[a] == 1)
print(ans)
# Original solution
n,*a=list(map(int,open(0).read().split()))
a.sort()
b=[0]*(10**6+1)
for i in a:
    b[i]+=1
    for j in range(2*i,10**6+1,i):
        b[j]+=2
print((b.count(1)))

# Optimized solution
n,*a=list(map(int,open(0).read().split()))
a.sort()
b=[0]*(10**6+1)
for i in a:
    b[i]+=1
    if b[i]==1:
        for j in range(2*i,10**6+1,i):
            b[j]+=100
print((b.count(1)))
# Original solution
from collections import Counter
n=int(eval(input()))
a=sorted(list(map(int,input().split())))
count=0
b=Counter(a)
count_list=[0]*(10**6)
for i in a:
  if b[i]==1:
    if count_list[i-1]==0:
      count+=1
      j=1
      while i*j<=10**6:
        count_list[i*j-1]+=1
        j+=1
  else:
    j=2
    while i*j<=10**6:
      count_list[i*j-1]+=1
      j+=1
print(count)

# Optimized solution
from collections import Counter
n=int(eval(input()))
a=sorted(list(map(int,input().split())))
a_max=a[-1]
count=0
b=Counter(a)
count_list=[0]*(a_max)
for i in a:
  if b[i]==1:
    if count_list[i-1]==0:
      count+=1
      j=1
      while i*j<=a_max:
        count_list[i*j-1]+=1
        j+=1
  else:
    j=2
    while i*j<=a_max:
      count_list[i*j-1]+=1
      j+=1
print(count)
# Original solution
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)
from bisect import bisect_left


def divisors(n):
    ret = set()
    for i in range(1, int(n ** 0.5) + 1):
        d, m = divmod(n, i)
        if m == 0:
            ret.add(i)
            ret.add(d)
    return ret


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

    # 愚直に行うとO(N^2)となる
    # 各要素、約数を列挙(sqrt(N))
    # 約数がこれまでに存在したかをチェックO(1)*約数の個数
    # 存在すれば1を加える

    # print(A)
    ans = 0
    history = [False]*N
    for i in range(N):
        if history[i]:
            continue
        # A[i]を乗じていくとどうか
        for j in range(i+1, N):
            if A[j] % A[i] == 0:
                history[j] = True
        if i+1 < N and A[i] == A[i+1]:
            history[i] = True
    print((N-sum(history)))

    return


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)
from bisect import bisect_left


def divisors(n):
    ret = set()
    for i in range(1, int(n ** 0.5) + 1):
        d, m = divmod(n, i)
        if m == 0:
            ret.add(i)
            ret.add(d)
    return ret


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

    # 愚直に行うとO(N^2)となる
    # 各要素、約数を列挙(sqrt(N))
    # 約数がこれまでに存在したかをチェックO(1)*約数の個数
    # 存在すれば1を加える

    # print(A)
    ans = 0
    history = [False]*N
    for i in range(N):
        if history[i]:
            continue
        # A[i]を乗じていくとどうか
        k = i
        for j in range(2, A[-1]//A[i] + 1):
            k = bisect_left(A, A[i]*j, lo=k)
            # print(A[i], A[i]*j, k, A[k])
            if A[k] % A[i] == 0:
                history[k] = True
        #
        k = bisect_left(A, A[i])
        if k < i:
            history[i] = True
        if i+1 < N and A[i] == A[i+1]:
            history[i] = True
    print((N-sum(history)))

    return


if __name__ == '__main__':
    main()
# Original solution
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)
from bisect import bisect_left


def divisors(n):
    ret = set()
    for i in range(1, int(n ** 0.5) + 1):
        d, m = divmod(n, i)
        if m == 0:
            ret.add(i)
            ret.add(d)
    return ret


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

    # 愚直に行うとO(N^2)となる
    # 各要素、約数を列挙(sqrt(N))
    # 約数がこれまでに存在したかをチェックO(1)*約数の個数
    # 存在すれば1を加える

    # print(A)
    ans = 0
    history = [False]*N
    for i in range(N):
        if history[i]:
            continue
        # A[i]を乗じていくとどうか
        k = i
        for j in range(2, A[-1]//A[i] + 1):
            k = bisect_left(A, A[i]*j, lo=k)
            # print(A[i], A[i]*j, k, A[k])
            if A[k] % A[i] == 0:
                history[k] = True
        #
        k = bisect_left(A, A[i])
        if k < i:
            history[i] = True
        if i+1 < N and A[i] == A[i+1]:
            history[i] = True
    print((N-sum(history)))

    return


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)
from bisect import bisect_left


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

    # 愚直に行うとO(N^2)となる
    # エラトステネスの篩を真似ると、NlogNで済む
    # 同じ数字が存在している場合は、注意する

    table = [False]*(A[-1]+1)
    ans = 0
    for i in range(N):
        # すでに何かの倍数ならば、考える必要なし
        if table[A[i]]:
            continue
        # 最大値まで見ていく
        for j in range(2, A[-1]//A[i]+1):
            table[A[i]*j] = True

    ans = 0
    for i in range(N):
        if table[A[i]] is False:
            ans += 1
            if i == 0:
                if len(A) == 1:
                    break
                if A[0] == A[1]:
                    ans -= 1
            elif i == N-1:
                if A[N-1] == A[N-2]:
                    ans -= 1
            else:
                if A[i] == A[i-1] or A[i] == A[i+1]:
                    ans -= 1
    print(ans)

    return


if __name__ == '__main__':
    main()
# Original solution
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)


def eratosthenes_sieve(n):
    table = [0] * (n + 1)
    prime_list = []

    for i in range(2, n + 1):
        if table[i] == 0:
            prime_list.append(i)
            for j in range(i + i, n + 1, i):
                table[j] = 1

    return prime_list


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

    ans = 0
    m = max(A)
    zeta = [0]*(m+1)
    for a in A:
        zeta[a] += 1

    # 素数の列挙
    primes = eratosthenes_sieve(m)
    # ゼータ変換
    for p in primes:
        for i in range(1, m//p+1):
            zeta[p*i] += zeta[i]

    for a in A:
        if zeta[a] == 1:
            ans += 1
    print(ans)

    # print(zeta)
    # for a in A:
    # print(a, zeta[a])

    return


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
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() for _ in range(n)]


INF = float("inf")
MOD = 10**9 + 7


def main():
    N = INT()
    A = LIST()
    A.sort()
    M = A[-1] + 1
    table = [0] * (M)

    for i in A:
        if table[i] == 0:
            table[i] = -1
            for j in range(i + i, M, i):
                table[j] = 1
        elif table[i] == -1:
            # 重複しているということ
            table[i] = -2
    # print(table)
    cnt = 0
    for i in range(N):
        if table[A[i]] == -1:
            cnt += 1
    print(cnt)

    return


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

ans = 0

while len(a) > 1:
    a0 = a[0]
    i_s = []
    for i in range(1,len(a)):
        if a[i]%a0 == 0:
            i_s.append(i)
    if a0 != a[1]:
        for i in range(len(i_s))[::-1]:
            a.pop(i_s[i])
        a.pop(0)
        ans += 1
    else:
        for i in range(len(i_s))[::-1]:
            a.pop(i_s[i])
        a.pop(0)

if len(a) == 1:
    ans += 1

print(ans)

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

ans = 0

baisu = [0]*(a[n-1]+1)
an = a[n-1]

for i in range(n):
    a0 = a[i]
    a1 = a0
    while a1 <= an:
        baisu[a1] += 1
        a1 += a0


for i in range(n):
    if baisu[a[i]] == 1:
        ans += 1
print(ans)
# Original solution
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(eval(input()))
def inputMap(): return list(map(int, input().split()))
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()
	A = inputList()

	A.sort()
	refd = [0 for i in range(1000000 + 1)]
	for i,val in enumerate(A):
		for j in range(val,1000000 + 1,val):
			refd[j] += 1

	ans = 0
	for i,val in enumerate(A):
		if refd[val] < 2:
			ans += 1

	print(ans)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()


# Optimized solution
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(eval(input()))
def inputMap(): return list(map(int, input().split()))
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()
	A = inputList()

	A.sort()
	zyuufuku = {}
	for i,val in enumerate(A):
		if i == 0:
			continue
		if val == A[i-1]:
			if val in zyuufuku:
				pass
			else:
				zyuufuku[val] = 1

	refd = [0 for i in range(1000000 + 1)]
	for i,val in enumerate(A):
		if val in zyuufuku:
			if zyuufuku[val] > 2:
				continue
			else:
				zyuufuku[val] += 1
		for j in range(val,1000000 + 1,val):
			refd[j] += 1

	ans = 0
	for i,val in enumerate(A):
		if val in zyuufuku:
			continue
		if refd[val] < 2:
			ans += 1

	print(ans)

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

MAX = 1000005
cnt = [0] * MAX
for x in a:
    if cnt[x] > 2:
        continue
    #cnt配列の各倍数のところに+1
    for i in range(x, MAX, x):
        cnt[i] += 1
ans = 0
for x in a:
    if cnt[x] == 1:
        ans += 1

print(ans)

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

MAX = 1000005
cnt = [0] * MAX
for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    #cnt配列の各倍数のところに+1
    for i in range(x, MAX, x):
        cnt[i] += 1
ans = 0
for x in a:
    if cnt[x] == 1:
        ans += 1

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

total = 0
flag = 0

for i in range(n):
  if i != n-1:
    if a[i] == a[i + 1]:
      continue
  for j in range(i):
    if i == j:
      continue
    
    if int(a[i]/a[j]) == a[i]/a[j]:
      flag = 1
      break
    
  if flag == 0:
    total += 1
  else:
    flag = 0
    
print(total)

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

max_a = max(a)
l = [0] * max_a

for i in range(n):
  j = 1
  while a[i] * j - 1 < max_a:
    l[a[i] * j - 1] += 1
    j += 1

count = 0

for i in range(n):
  if l[a[i] - 1] == 1:
    count += 1

print(count)
# Original solution
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))

import math

MAX=10**6+1

n=ni()
a=nl()

s = [0]*(MAX)

for ai in a:
  if s[ai]==2:
    continue
  for i in range(ai,MAX,ai):
    s[i]+=1

cnt=0
for ai in a:
  if s[ai]==1:
    cnt+=1

print(cnt)

# Optimized solution
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))

import math

MAX=10**6+1

n=ni()
a=nl()

s = [0]*(MAX)

for ai in a:
  if s[ai]!=0:
    s[ai]=2
    continue
  for i in range(ai,MAX,ai):
    s[i]+=1

cnt=0
for ai in a:
  if s[ai]==1:
    cnt+=1

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


count = 0
for i in range(N):
    is_ans = True
    for j in range(N):
        if i != j:
            if A[i] % A[j] == 0:
                is_ans = False
                break

    if is_ans:
        count += 1

print(count)


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


def solve2(N, A):
    A.sort()
    amax = A[-1]
    dp = [True] * (amax + 1)
    cnt = [0] * (amax + 1)

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

    for i in range(amax):
        x = i + 1
        if cnt[x] > 1:
            dp[x] = False

        if cnt[x] > 0:
            y = x * 2
            while y <= amax:
                dp[y] = False
                y += x

    ansval = [x for x in A if dp[x]]

    # print(ansval)
    ans = len(ansval)

    return ans


def solve1(N, A):
    ans = 0
    for i in range(N):
        is_ans = True
        for j in range(N):
            if i != j:
                if A[i] % A[j] == 0:
                    is_ans = False
                    break

        if is_ans:
            ans += 1

    return ans


print((solve2(N, A)))
# Original solution
n = int(eval(input()))
a = [int(i) for i in input().split()]


l = [0] * (max(a)+1)


# for i in a:

#     c = 1
#     while True:
#         if i*c >= max(a):
#             break
#         l[i*c - 1] += 1
#         c += 1



for i in a:
    for j in range(i,max(a)+1, i):
        l[j] += 1



ans = 0

for i in set(a):
    if l[i] == 1:
        ans += 1

print(ans)


# Optimized solution
n = int(eval(input()))
A = list(map(int,input().split()))
 
maxA = max(A)
ans = 0
flag = [0]*(maxA+1)
 
# print(flag)
for a in A:
    for ax in range(a,maxA+1,a):
        flag[ax] +=1
 
# print(flag)
for a in set(A):
    if flag[a] == 1:
        ans += 1
print(ans)
# Original solution
number = int(eval(input()))
# values = [i+2 for i in range(2*10**5)]
values = list(map(int, input().split()))

maxV = 10**6+1
dp = [0]*(maxV)

for a in values:
    i = 1
    if dp[a] > 1:
        continue
    while i * a < maxV:
        i_a = i * a
        dp[i_a] = dp[i_a] + 1
        i += 1

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

print(count)


# Optimized solution
number = int(eval(input()))
# values = [i+2 for i in range(2*10**5)]
values = list(map(int, input().split()))

maxV = 10**6+1
dp = [0]*(maxV)

for a in values:
    i = 1
    if dp[a] > 0:
        dp[a] = dp[a] + 1
        continue
    while i * a < maxV:
        i_a = i * a
        dp[i_a] = dp[i_a] + 1
        i += 1

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

print(count)
# Original solution
import collections

def divisor(n):
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i ** 2 == n:
                continue
            d.append(n // i)
    return d

n = int(eval(input()))
A = list(map(int, input().split()))
set_A = set(A)

cnt = [0]*(max(A)+1)
for a in A:
    tmp = set(divisor(a)) & set_A
    if len(tmp) == 1: cnt[a] += 1

ans = collections.Counter(cnt)
print((ans[1]))

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

MAX_N = max(A)+1
cnt = [0] * MAX_N 

for a in A:
  for i in range(a, MAX_N, a):
    if cnt[i] <= 2: cnt[i] += 1

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

MAX_N = max(A)+1
cnt = [0] * MAX_N 

for a in A:
  for i in range(a, MAX_N, a):
    if cnt[i] <= 2: cnt[i] += 1

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

# Optimized solution
def main():
  ## IMPORT MODULE
  #import sys

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 5
    A = [24, 11, 8, 3, 16]

  else:
    ##INPUT 
    n = int(eval(input()))
    A = list(map(int, input().split()))

  ## SUBMITION CODES HERE
  MAX_N = max(A)+1
  cnt = [0] * MAX_N 

  for a in A:
    for i in range(a, MAX_N, a):
      if cnt[i] <= 2: cnt[i] += 1

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

dp = [0]*(10**6+1)

for i in arr:
    for j in range(i, len(dp), i):
        if j in arr:
            dp[j] += 1
print((dp.count(1)))

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

dp = [0]*(10**6+1)

for i in sorted(arr):
    dp[i] += 1
    if dp[i] == 1:
        for j in range(2*i, len(dp), i):
            dp[j] += 2
print((dp.count(1)))
# Original solution
import math
def sieve(n, done):
    for i in range(n, 10**6+1, n):
        done[i] = 1

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

ans = 0
done = [0] * (10 ** 6 + 1)

for i in range(n):
    num = a[i]
    if i < n-1 and a[i] == a[i+1]:
        sieve(num, done)
        continue
    
    if not done[num]:
        sieve(num, done)
        ans += 1

print(ans)


# Optimized solution
import math
def sieve(n, done):
    for i in range(n, 10**6+1, n):
        done[i] = 1

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

ans = 0
done = [0] * (10 ** 6 + 1)

for i in range(n):
    num = a[i]
    if i < n-1 and a[i] == a[i+1]:
        if i > 0 and a[i] == a[i-1]:
            continue
        sieve(num, done)
        continue
    
    if not done[num]:
        sieve(num, done)
        ans += 1

print(ans)
# Original solution
# distutils: language=c++
# cython: language_level=3, boundscheck=False, wraparound=False
# cython: cdivision=True

def INT(): return int(eval(input()))
def MAPINT(): return list(map(int, input().split()))
def LMAPINT(): return list(map(int, input().split()))
def STR(): return eval(input())
def MAPSTR(): return list(map(str, input().split()))
def LMAPSTR(): return list(map(str, input().split()))

def main():
  n = INT()
  a = LMAPINT()

  ans = [0] * (max(a) + 1)
  for x in a:
    if ans[x] == 0:
      for j in range(x, max(a)+1, x):
        ans[j] += 1
    else:
      ans[x] += 1

  print((len(list([x for x in a if ans[x] == 1]))))

  
if __name__ == '__main__':
  main()

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

  ans = [0] * (max(a) + 1)
  length = max(a) + 1
  for x in a:
    if ans[x] == 0:
      for j in range(x, length, x):
        ans[j] += 1
    else:
      ans[x] += 1

  print((len(list([x for x in a if ans[x] == 1]))))

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

i = 0
while i < N - 1:  
  j = i + 1
  while j < N:
    if As[j] % As[i] == 0:
      if As[j] in As_set:
        As_set.remove(As[j])
      As.pop(j)
      N -= 1
    else:
      j += 1
  i += 1
  
print((len(As_set)))

# 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
# ABC170

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

a.sort()
maxa = max(a)
dp = [True for _ in range(maxa+1)]

ans = 0
for ai in a:
    if dp[ai]:
        for i in range(0, maxa+1, ai):
            dp[i] = False
        if a.count(ai) == 1:
            ans += 1

print(ans)


# Optimized solution
# ABC170

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

a.sort()
a_max = max(a)
dp = [True for _ in range(a_max+1)]

ans = 0
for i in range(n):
    if dp[a[i]]:
        for j in range(0, a_max+1, a[i]):
            dp[j] = False
        if i > 0:
            if a[i] == a[i-1]:
                continue
        if i < n-1:
            if a[i] == a[i+1]:
                continue
        ans += 1

print(ans)
# Original solution
from bisect import bisect, bisect_left
N = int(eval(input()))
A = list(map(int, input().split()))
A_ = sorted(list(set(A)))
A = sorted(A)
ans = 0
i = 0
while i < len(A_):
  a = A_[i]
  j = bisect_left(A_, a*2)
  while j < len(A_):
    if A_[j] % a == 0:
      A_.pop(j)
    else:
      j += 1
  if bisect(A, a)-bisect_left(A, a) > 1:
    ans -= 1
  i += 1
print((ans+len(A_)))



# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
M = max(A)
memo = [0]*(M+1)
i = 0
while i < N:
  a = A[i]
  memo[a] += 1
  x = a+a
  while x <= M:
    memo[x] += 2
    x += a
  i += 1
print((sum([1 if m == 1 else 0 for m in memo])))
# Original solution
def main():
    _ = int(eval(input()))
    A = list(map(int, input().split()))

    A.sort()
    B = []
    sames = set()

    for a in A:
        isDividable = False
        for b in B:
            if a == b:
                sames.add(b)

            if a % b == 0:
                isDividable = True
                break

        if not isDividable:
            B.append(a)

    print((len(B) - len(sames)))


if __name__ == '__main__':
    main()


# Optimized solution
# import collections


def main():
    _ = int(eval(input()))
    A = list(map(int, input().split()))

    A.sort()

    # sames = 0
    # C = collections.Counter(A)
    # for v in C.values():
    #     if v > 1:
    #         sames += 1

    a_max = A[-1]
    dp = [0] * (a_max + 1)
    # dp = [True] * a_max
    # A = set(A)

    for a in A:
        if dp[a] != 0:
            dp[a] = 2
            continue

        i = a
        while i < a_max + 1:
            dp[i] += 1
            i += a

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

    print(r)

    #     if dp[a - 1]:
    #         tmp_a = a * 2
    #         while tmp_a < a_max + 1:
    #             dp[tmp_a - 1] = False
    #             tmp_a += a

    # r = 0
    # for a in A:
    #     if dp[a - 1]:
    #         r += 1

    # print(r - sames)


if __name__ == '__main__':
    main()