CodeEff/ECCO huggingface dataset:
# Original solution

def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    A = list(map(int, input().split()))

    d = dict()
    for x in A:
        if x in d:
            d[x] += 1
        else:
            d[x] = 1
    A.sort()

    ans = 0
    dp = [True]*N

    for i in range(N):
        if dp[i]:
            if d[A[i]] == 1:
                ans += 1
            dp[i] = False
            for j in range(i+1, N):
                if dp[j]:
                    if A[j] % A[i] == 0:
                        dp[j] = False
        else:
            continue

    print(ans)


main()


# Optimized solution

def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    A = list(map(int, input().split()))

    d = dict()
    for x in A:
        if x in d:
            d[x] += 1
        else:
            d[x] = 1
    A.sort()

    ans = 0
    M = max(A)
    dp = [True]*(M+1)
    for x in A:
        for xx in range(x+x, M+1, x):
            dp[xx] = False
    for x in A:
        if d[x] == 1 and dp[x]:
            ans += 1
    print(ans)


main()
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
cola = Counter(a)
mult = [True] * (10**6+1)
seta = list(set(a))

for s in seta:
    tmp = s * 2
    while tmp <= 10 ** 6:
        mult[tmp] = False
        tmp += s

ans = 0
for s in seta:
    if cola[s] == 1 and mult[s] == True:
        ans += 1

print(ans)


# Optimized solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
m = [True] * (10**6+1)
s = list(set(a))
for u in s:
    t = u * 2
    while t <= 10 ** 6:
        m[t] = False
        t += u
r = 0
for u in s:
    if c[u] == 1 and m[u] == True:
        r += 1
print(r)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ls = [1]*(10**6+1)
cnt = [0]*(10**6+1)
for i in range(n):
    cnt[a[i]] += 1
    if ls[a[i]] == 1:
        for j in range(a[i]*2, 10**6+1, a[i]):
            ls[j] = 0
ans = 0
for i in range(n):
    if ls[a[i]] == 1 and cnt[a[i]] == 1:
        ans += 1
print(ans)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ls = [1] * (10 ** 6 + 1)
cnt = [0] * (10 ** 6 + 1)
for i in range(n):
    cnt[a[i]] += 1
    if cnt[a[i]] == 1:
        if ls[a[i]] == 1:
            for j in range(a[i] * 2, 10 ** 6 + 1, a[i]):
                ls[j] = 0
ans = 0
for i in range(n):
    if ls[a[i]] == 1 and cnt[a[i]] == 1:
        ans += 1
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

a.sort()

v = [True] * 1000010
v2 = [False] * 1000010
for i in range(n):
    j = 2
    while a[i]*j < 1000010:
        v[a[i]*j] = False
        j += 1
    if v2[a[i]]:
        v[a[i]] = False
    v2[a[i]] = True

ans = 0

for i in range(n):
    if v[a[i]]:
        ans += 1

print(ans)

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

a.sort()

M = 1000005
cnt = [0] * M

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

ans = 0

for i in range(n):
    if cnt[a[i]] == 1:
        ans += 1

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

x = max(a)
dp = [0] * (x+1)
for ai in a:
    i = 1
    if dp[ai] <= 2:
        while i * ai <= x:
            dp[i * ai] += 1
            i += 1

ans = 0
for ai in a:
    if dp[ai] <= 1:
        ans += 1

print(ans)

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

x = max(a)
dp = [0] * (x+1)
for ai in a:
    i = 1
    if dp[ai] <= 2:
        while i * ai <= x:
            dp[i * ai] += 1
            i += 1

ans = 0
for ai in a:
    if dp[ai] <= 1:
        ans += 1

print(ans)
# Original solution
import sys
input = lambda: sys.stdin.readline().rstrip()

div = [0] * 1000005

N = int(eval(input()))

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

for num in A:
    if div[num] == 0:
        for i in range(num, 1000004, num):
            div[i] += 1
    elif div[num] != 0:
        div[num] += 1        

ans = 0

for num in A:
    if div[num] == 1:
        ans += 1

print(ans)

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

N = int(eval(input()))
div = [0] * 1000005

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

for num in A:
    if div[num] == 0:
        for i in range(num, 1000005, num):
            div[i] += 1
    else:
        div[num] += 1
ans = 0
for num in A:
    if div[num] == 1:
        ans += 1

print(ans)
# Original solution
M = 10 ** 6 + 5
N = int(eval(input()))
A = list(map(int, input().split()))
cnt = [0] * M
ans = 0
for i in A:
    for j in range(0, M, i):
        cnt[j] += 1
for i in A:
    if(cnt[i] == 1):
        ans += 1
print(ans)

# Optimized solution
M = 10 ** 6 + 5
N = int(eval(input()))
A = list(map(int, input().split()))

cnt = [0] * M
for i in A:
    if(cnt[i] >= 2):
        continue
    for j in range(i, M, 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=[int(x) for x in input().split()]
a.sort()
max=a[-1]
dp=[False for _ in range(max+1)]

for i in a:
    if dp[i]==False:
        j=1
        while 1:
            j+=1
            if i*j>max:
                break
            dp[i*j]=True
for i in a:
    if a.count(i)>1:
        dp[i]=True
cnt=0
for i in a:
    if dp[i]==False:
        cnt+=1

print(cnt)



# Optimized solution
n=int(eval(input()))
a=[int(x) for x in input().split()]
a.sort()
max=a[-1]
dp=[False for _ in range(max+1)]

for i in a:
    if dp[i]==False:
        j=1
        while 1:
            j+=1
            if i*j>max:
                break
            dp[i*j]=True
for i in range(len(a)-1):
    if a[i]==a[i+1]:
        dp[a[i]]=True
cnt=0
for i in a:
    if dp[i]==False:
        cnt+=1

print(cnt)
# Original solution
import sys

def solve(a,n):
    m = a[-1]+1
    ava = [0]*m
    for rep in a:
        ava[rep] += 1
        if ava[rep]:
            for i in range(2*rep,m,rep):
                ava[i] += 2
    return ava.count(1)
 
if __name__=='__main__':
    n = int(sys.stdin.readline().rstrip())
    a = list(map(int,sys.stdin.readline().rstrip().split()))
    a.sort()
    print((solve(a,n)))

# Optimized solution
import sys
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return list(map(int,sys.stdin.readline().rstrip().split()))

def solve():
    m = a[-1]+1
    ava = [0]*m
    for rep in a:
        ava[rep] += 1
        if ava[rep]==1:
            for item in range(2*rep,m,rep):
                ava[item] += 2

    print((ava.count(1)))
    return

if __name__=='__main__':
    n = I()
    a = list(IL())
    a.sort()
    solve()
# Original solution
from math import sqrt

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
#print(A)
ans = []
res = []
nans = 0
doubling = 0
i = 0
while i < N:
  a = A[i]
  #sqa = sqrt(a)
  #print(i,a)
  if i == 0:
    flag = False
    while i + 1 < N:
      bufa = A[i+1]
      if bufa == a:
        i += 1
        flag = True
      else:
        break
    if flag:
      nans += 1
      doubling += 1
      ans.append(a)
    else:
      nans += 1
      ans.append(a)
      res.append(a)
  elif i < N-1:
    flag = False
    while i + 1 < N:
      bufa = A[i+1]
      if bufa == a:
        i += 1
        flag = True
      else:
        break
    if flag:
      d = 0
      flag2 = True
      while 1:
        if a%ans[d] == 0:
          flag2 = False
          break
        if nans -1 == d:
          break
        d += 1
      if flag2:
        nans += 1
        doubling += 1
        ans.append(a)
    else:
      d = 0
      flag2 = True
      while 1:
        if a%ans[d] == 0:
          flag2 = False
          break
        if nans -1 == d:
          break
        d += 1
      if flag2:
        nans += 1
        ans.append(a)
        res.append(a)
  else:
    d = 0
    flag2 = True
    while 1:
      if a%ans[d] == 0:
        flag2 = False
        break
      if nans -1 == d:
        break
      d += 1
    if flag2:
      nans += 1
      ans.append(a)
      res.append(a)
  i += 1
        
        
print((len(res)))

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

A.sort()
maxA = A[-1]
dp = [-1 for i in range(maxA+1)]
for a in A:
  if dp[a] != 0:
    if dp[a] == 1:
      dp[a] = 0
      continue
    dp[a] = 1
    for i in range(2*a, maxA+1, a):
      dp[i] = 0
ans = 0
for a in A:
  if dp[a] == 1:
    ans += 1
print(ans)
# Original solution
#

import sys
input=sys.stdin.readline

def main():
    N=int(eval(input()))
    A=list(map(int,input().split()))
    SUGOI=[False]*(10**6+1)
    for a in A:
        for j in range(2*a,10**6+1,a):
            SUGOI[j]=True
    cnt=0
    for a in A:
        if A.count(a)==1 and SUGOI[a]==False:
            cnt+=1
    print(cnt)
    
    
if __name__=="__main__":
    main()


# Optimized solution
#

import sys
input=sys.stdin.readline

def main():
    N=int(eval(input()))
    A=list(map(int,input().split()))
    A.sort()
    cho=set()
    for i in range(len(A)-1):
        if A[i]==A[i+1]:
            cho.add(A[i])
    A=list(set(A))
    SUGOI=[False]*(10**6+1)
    for a in A:
        for j in range(2*a,10**6+1,a):
            SUGOI[j]=True
    cnt=0
    A=list(set(A)-cho)
    for a in A:
        if SUGOI[a]==False:
            cnt+=1
    print(cnt)
    
    
if __name__=="__main__":
    main()
# Original solution
N = int(eval(input()))
A = [int(i) for i in input().split()]
A.sort()
c = [False]*N
ans = 0
for i in range(N):
    if c[i]:
        continue
    if i == N-1 or A[i] != A[i+1]:
        ans += 1
    if i == N-1:
        break
    for j in range(i+1,N):
        if not c[j] and A[j]%A[i]==0:
            c[j] = True
print(ans)

# Optimized solution
N = int(eval(input()))
A = [int(i) for i in input().split()]
A.sort()
B = [True]*(A[-1]+1)
i = 0
for i in range(N):
  if i < N-1 and A[i] == A[i+1]:
    B[A[i]] = False
  if A[-1] < 2*A[i]:
    continue
  M = A[-1]//A[i]+1
  for j in range(2,M):
    B[j*A[i]] = False

ans = 0
for a in A:
  if B[a]:
    ans += 1
print(ans)
# Original solution
# -*- coding: utf-8 -*-

# 入力を整数に変換して受け取る
def input_int():
    return int(eval(input()))


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return list(map(int, input().split()))


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


import itertools
import math
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(math.sqrt(n)) + 1):
       if temp%i == 0:
           cnt=0
           while temp%i == 0:
               temp //= i
               arr.append(i)

    arr.append(temp)

    ret = set()
    for val in itertools.product([0, 1], repeat = len(arr)):
        cal = 1
        for i, v in enumerate(val):
            if v == 1:
                cal *= arr[i]

        ret.add(cal)
    return ret - set([n])


def main():
    n = input_int()
    a_list = input_to_int_tuple()

    a_set = set(a_list)
    cnt = 0

    import collections
    for val, val_cnt in list(collections.Counter(a_list).items()):
        if val_cnt > 1:
            continue

        flg = False
        for i in factorization(val):
            if i in a_set:
                flg = True
                break

        if not flg:
            cnt += 1

    # for i, val in enumerate(a_sorted_list):
    #     flg = True
    #
    #     for devide_val in a_sorted_list[:i]:
    #         if val % devide_val == 0:
    #             flg = False
    #
    #     if flg:
    #         cnt += 1

    return cnt


if __name__ == "__main__":
    print((main()))


# Optimized solution
# -*- coding: utf-8 -*-

# 入力を整数に変換して受け取る
def input_int():
    return int(eval(input()))


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return list(map(int, input().split()))


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    a_list = input_to_int_tuple()

    a_sorted = list(sorted(a_list))

    max_val = a_sorted[-1]
    cands = [0] * max_val

    for num in a_sorted:
        # if cands[num - 1] >= 2:
        #     continue
        for i in range(num, max_val + 1, num):
            cands[i - 1] += 1

    ans = 0
    for num in a_sorted:
        if cands[num - 1] == 1:
            ans += 1

    return ans


if __name__ == "__main__":
    print((main()))
# Original solution
import sys
def main():
    input = sys.stdin.readline
    N = int(eval(input()))
    *A, = list(map(int, input().split()))
    w = [0] * (10 ** 6 + 1)
    for a in A:
        w[a] += 1
    for a in A:
        for b in range(a * 2, 10 ** 6 + 1, a):
            w[b] = 0
        if w[a] >= 2:
            w[a] = 0
    print((sum(w)))

if __name__ == '__main__':
    main()


# Optimized solution
import sys
def main():
    input = sys.stdin.readline
    N = int(eval(input()))
    *A, = list(map(int, input().split()))
    w = [0] * (10 ** 6 + 1)
    for a in A:
        w[a] += 1
    f = [False] * (10 ** 6 + 1)
    for a in A:
        if f[a]:
            w[a] = 0
            continue
        for b in range(a * 2, 10 ** 6 + 1, a):
            w[b] = 0
        f[a] = True
    print((sum(w)))

if __name__ == '__main__':
    main()
# Original solution
import sys
def main():
    input = sys.stdin.readline
    N = int(eval(input()))
    *A, = list(map(int, input().split()))
    w = [0] * (10 ** 6 + 1)
    for a in A:
        w[a] += 1
    f = [False] * (10 ** 6 + 1)
    for a in A:
        if f[a]:
            w[a] = 0
            continue
        for b in range(a * 2, 10 ** 6 + 1, a):
            w[b] = 0
        f[a] = True
    print((sum(w)))

if __name__ == '__main__':
    main()


# Optimized solution
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys
def main(N, A):
    C = [0] * (10**6 + 1)
    for a in A:
        if C[a] == 1:
            C[a] = -1
            continue
        if C[a] == -1:
            continue
        C[a] = 1
        for b in range(a + a, 10 ** 6 + 1, a):
            C[b] = -1
    ans = 0
    for a in A:
        if C[a] == 1:
            ans += 1
    print(ans)

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

A.sort()
ok = [False] * N

for i in range(N):
    for j in range(i+1, N):
        if ok[j]:
            continue

        if A[i] == A[j]:
            ok[i] = True
            ok[j] = True

        if A[j] % A[i] == 0:
            ok[j] = True

print((N-sum(ok)))

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

amax = max(A)
sieve = [False] * (amax+1)
exist = [0] * (amax+1)

for a in A:
    if exist[a] > 0:
        exist[a] += 1
        continue
    exist[a] += 1
    for i in range(a*2, amax+1, a):
        sieve[i] = True

ans = 0
for a in A:
    if not sieve[a] and exist[a] == 1:
        ans += 1

print(ans)
# Original solution
from collections import Counter

N=int(eval(input()))
A=list(map(int,input().split()))
nmax=10**6
iscop=[True]*(nmax+1)
cnt=[0]*(nmax+1)

for a in A:
    cnt[a]+=1
    if iscop[a]==False:
        continue

    for j in range(2,nmax//a+1):
        iscop[j*a]=False
ans=0
for a in A:
    if cnt[a]<2 and iscop[a]:
        ans+=1

print(ans)

# Optimized solution
from collections import Counter

N=int(eval(input()))
A=Counter(list(map(int,input().split())))
nmax=10**6
iscop=[True]*(nmax+1)

for k in list(A.keys()):
    if iscop[k]==False:
        continue

    for j in range(2,nmax//k+1):
        iscop[k*j]=False
ans=0
for k,v in list(A.items()):
    if v<2 and iscop[k]:
        ans+=1

print(ans)
# Original solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
check = [1] * n
cnt = Counter(a)

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

ans = sum(check)
print(ans)

# Optimized solution
from collections import Counter
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
check = [True] * (a[-1] + 1)
cnt = Counter(a)

for i in range(n):
    if check[a[i]] == False:continue
    for j in range(a[i], a[-1] + 1, a[i]):
        if j == a[i]:continue
        check[j] = False

ans = 0
for i in range(n):
    if check[a[i]] and cnt[a[i]] == 1:ans += 1

print(ans)
# Original solution
from sys import stdin
import math
n = int(stdin.readline())
a = list(map(int,stdin.readline().split()))
a.sort()
ans = 0
seen = set()
for i in range(n):
    for j in range(1,math.floor(math.sqrt(a[i]))+1):
        if a[i]%j == 0:
            x,y = j,a[i]//j
            if x in seen or y in seen:
                break
    else:
        ans += 1 if i == n-1 or a[i] != a[i+1] else 0
    seen.add(a[i])
print(ans)


# Optimized solution
from sys import stdin
import math
n = int(stdin.readline())
a = list(map(int,stdin.readline().split()))
a.sort()
ans = 0
maxval = a[-1]
seen = set()
for i in range(n):
    if a[i] not in seen and (i == n-1 or a[i] != a[i+1]):
        ans += 1
    j = a[i]
    while j <= maxval:
        seen.add(j)
        j += a[i]
print(ans)
# Original solution
from sys import stdin
import math
n = int(stdin.readline())
a = list(map(int,stdin.readline().split()))
a.sort()
ans = 0
numset = set(a)
maxval = 10**6
dp = [0]*(maxval+1)
for i in range(n):
    if dp[a[i]] == 0 and (i == n-1 or a[i] != a[i+1]):
        ans += 1
    j = a[i]
    while j <= maxval:
        dp[j] += 1
        j += a[i]
print(ans)

# Optimized solution
from sys import stdin
import math
n = int(stdin.readline())
a = list(map(int,stdin.readline().split()))
a.sort()
ans = 0
numset = set(a)
maxval = 10**6
dp = [0]*(maxval+1)
for i in range(n):
    if dp[a[i]] >= 1: continue
    if dp[a[i]] == 0 and (i == n-1 or a[i] != a[i+1]):
        ans += 1
    j = a[i]
    while j <= maxval:
        dp[j] += 1
        j += a[i]
print(ans)
# Original solution
N = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
n = 0
for i in range(N):
  d = True
  for j in range(N):
    if a[i] < a[j]:
      break
    elif i != j and a[i] % a[j] == 0:
      d = False
      break
  if d:
    n += 1
print(n)

# Optimized solution
N = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
A = max(a)
b = [0]*A
for i in range(N):
  if b[a[i]-1] == 0:
    for j in range(a[i], A+1, a[i]):
      b[j-1] += 1
  elif b[a[i]-1] == 1:
      b[a[i]-1] += 1
n = 0      
for i in range(N):
  if b[a[i]-1] == 1:
    n += 1
print(n)
# Original solution
import collections
n = int(input())
ais = list(map(int,input().split()))
cc = collections.Counter(ais)
s = {ai:True for ai in ais}
m = max(ais)
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[c] = False
		c+= a
count = 0
for ai in s:
	if s[ai]:
		count +=1

print(count)

# Optimized solution
import collections 
n,cc = int(input()), collections.Counter(list(map(int,input().split())))
m,s = max(cc.keys()),{ai:True for ai in cc}
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[c] = False
		c += a
count = 0
for a in s:
	if s[a]: count +=1
print(count)
# Original solution
import collections 
n,cc = int(input()), collections.Counter(list(map(int,input().split())))
m,s = max(cc.keys()),{ai:True for ai in cc}
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[c] = False
		c += a
count = 0
for a in s:
	if s[a]: count +=1
print(count)

# Optimized solution
import collections 
n,cc = int(input()), collections.Counter(list(map(int,input().split())))
m,s = max(cc.keys()),{ai:True for ai in cc}
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[c] = False
		c += a
count = 0
for v in list(s.values()):
	if v: count +=1
print(count)
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
L=sorted(A)
l=[]
for i in L:
    if L.count(i)==1:
        l.append(i)
for i in l:
    for j in l[l.index(i)+1:]:
        if j%i==0:
            l.pop(l.index(j))
        else:
            None
print((len(l)))



    
















        


























            
    


    


    
    














    


    














# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
A.sort()
Amax=A[-1]
dp=[True]*(Amax+1)
ans=0
for i in range(N-1):
    p=A[i]
    if dp[p]:
        for j in range(1,Amax//p+1):
            dp[p*j]=False
        if p!=A[i+1]:
            ans+=1
if dp[Amax]:
    ans+=1
print(ans)
# Original solution
from collections import Counter

n = int(eval(input()))
a = [int(x) for x in input().split()]
cnt = [0] * (10**6 + 1)

dic = Counter(a)

for i in set(a):
    if 1 < dic[i]:
        cnt[i] += 1
        
a = list(set(a))

for i in a:
    for j in range(10**6 + 1):
        if 10**6 < i * j:
            break
        
        cnt[i * j] += 1

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

# Optimized solution
from collections import Counter

n = int(eval(input()))
a = [int(x) for x in input().split()]
cnt = [0] * (10**6 + 1)

dic = Counter(a)

for i in set(a):
    if 1 < dic[i]:
        cnt[i] += 1
        
a = list(set(a))
a_max = max(a)
for i in a:
    for j in range(1, 10**6 + 1):
        if a_max < i * j:
            break
        
        cnt[i * j] += 1

ans = 0
for i in range(len(a)):
    if cnt[a[i]] == 1:
        ans += 1
        
print(ans)
# Original solution
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,*a = list(map(int,read().split()))

res = [0]*(1000001)
for i in a: res[i] += 1


def check(N,P):
    if N == 1:
        if P[1]==1: return True
        else: return False
    res = []
    for i in range(1,N):
        if i*i >= N: break
        if N%i == 0:
            res.append(i)
            res.append(N//i)
    if i*i == N: res.append(i)
    
    for i in res:
        if i!=N and P[i] >= 1: return False
        if i==N and P[i] >= 2: return False
    return True    

ans = 0
for N in a:
    if check(N,res): ans += 1

print(ans)



# Optimized solution
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,*a = list(map(int,read().split()))

P = [0]*(1000001)
for i in a: P[i] += 1


def check(N,P):
    if N == 1:
        if P[1]==1: return True
        else: return False

    if P[1] >= 1: return False
    if P[N] >= 2: return False
    i = 1
    
    for i in range(2,N):
        if i*i >= N: break
        if N%i == 0:
            #print(i,N)
            if P[i]>=1: return False
            if P[N//i]>=1: return False
    if i*i == N:
        if P[i]>=1: return False

    return True    

ans = 0
for N in a:
    if check(N,P): ans += 1

print(ans)
# Original solution
#!/usr/bin/env python3
import sys
import collections

input = sys.stdin.readline


def ST():
    return input().rstrip()


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(MI())


N = I()
A = LI()
A.sort()
cnt = collections.Counter(A)
MAX = A[-1] + 1
# end = A[-1] ** 0.5

for a in A:
    if cnt[a] >= 2:
        del cnt[a]
    for i in range(a * 2, MAX, a):
        del cnt[i]

print((sum(cnt.values())))


# Optimized solution
#!/usr/bin/env python3
import sys
import collections

input = sys.stdin.readline


def ST():
    return input().rstrip()


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(MI())


N = I()
A = LI()
A.sort()
cnt = collections.Counter(A)
end = A[-1] + 1

for a in A:
    if cnt[a] >= 2:
        del cnt[a]
    for i in range(a * 2, end, a):
        del cnt[i]

print((sum(cnt.values())))