CodeEff/ECCO huggingface dataset:
# Original solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))
lnii=lambda:list(map(int,stdin.readline().split()))
from collections import Counter

n=int(eval(input()))
l=lnii()

def eratosthenes(lim):
  num=[1 for i in range(lim)]
  for i in set(l):
    for j in range(i+i,lim,i):
      num[j]=0
  return num

lim=10**6+5
num=eratosthenes(lim)

count=Counter(l)

ans=0
for i in l:
  if num[i]==1 and count[i]==1:
    ans+=1

print(ans)

# Optimized solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))
lnii=lambda:list(map(int,stdin.readline().split()))
from collections import Counter

n=int(eval(input()))
l=lnii()

def eratosthenes(lim):
  num=[1 for i in range(lim)]
  for i in set(l):
    if num[i]:
      for j in range(i+i,lim,i):
        num[j]=0
  return num

lim=10**6+5
num=eratosthenes(lim)

count=Counter(l)

ans=0
for i in l:
  if num[i]==1 and count[i]==1:
    ans+=1

print(ans)
# Original solution
_,*a = list(map(int, open(0).read().split()))
a.sort()
m = -~a[-1]
c = [0]*m
for i in a:
    c[i] += 1
    if c[i] > 1:
        continue
    for j in range(i * 2, m, i):
        c[j] = 2
print((sum(c[i]==1for i in a)))

# Optimized solution
#!/usr/bin/env python3
_, *a = list(map(int, open(0).read().split()))
a.sort()
p = [0] * a[-1]
for i in a:
    for j in range(1, a[-1] // i + 1):
        p[j * i - 1] += j
print((sum(i == 1 for i in p)))
# Original solution
import sys

(n) = list(map(int, sys.stdin.readline().strip().split()))
list_input = list(map(int, input().split()))

# 1の数をカウント
counts_one = list_input.count(1)
if counts_one == 1:
    print(counts_one)
    sys.exit()
elif counts_one > 1:
    print((0))
    sys.exit()

# 全て同じ数字かチェック
counts_same = list_input.count(list_input[0])
if counts_same == n:
    print((0))
    sys.exit()

counts_two = list_input.count(2)

anti_ans = 0
list_a = list_input.copy()
for i in list_input:
    for iloop in range(len(list_a)-1):
        if i == 2 and counts_two == 1:
            break
        if i == 2 and counts_two >= 2:
            anti_ans += 1
            break
        if i != 2 and counts_two >= 2 and i % 2 == 0:
            anti_ans += 1
            break
        if i % list_a[iloop+1] == 0:
            anti_ans += 1
            break
    # a = list_a.pop(0)
    # list_a.append(a)
    list_a.append(list_a.pop(0))
print((len(list_input) - anti_ans))


# Optimized solution
import sys

n = int(eval(input()))
list_input = list(map(int, sys.stdin.readline().split()))

list_input.sort()

# 倍数判断用のリストを作成
list_div = [0]*(max(list_input))

for i in list_input:
    # print(i)
    a = list_div[i-1]
    # list_div[i-1::i] = [1]*(len(list_div[i-1::i]))
    list_div[i-1::i] = [x+1 for x in list_div[i-1::i]]
    if a == 1:
        pass
    else:
        # list_div[i-1] = 0
        pass

ans = 0
for i in list_input:
    if list_div[i-1] == 1:
        ans += 1

print(ans)
# Original solution
from sys import stdin
readline = stdin.readline
def i_input(): return int(readline().rstrip())
def i_map(): return list(map(int, readline().rstrip().split()))
def i_list(): return list(i_map())


def main():
    N = i_input()
    A = i_list()
    ans = 0
    for i, a in enumerate(A):
        for ii, aa in enumerate(A):
            if i == ii:
                continue
            if a % aa == 0:
                break
        else:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()


# Optimized solution
from sys import stdin
readline = stdin.readline
def i_input(): return int(readline().rstrip())
def i_map(): return list(map(int, readline().rstrip().split()))
def i_list(): return list(i_map())

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

def main():
    N = i_input()
    A = i_list()
    ans = 0
    max_a = max(A)
    p = [0] * (max_a + 1)
    for i in A:
        for j in range(i , max_a + 1, i):
            p[j] += 1
    for i in A:
        if p[i] < 2:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()
# Original solution
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]
    A.sort()

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

    for a in A:
        for i in range(1, 10 ** 6 + 1):
            if a * i > 10 ** 6:
                break
            ans[a * i] += 1

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

    print(res)



if __name__ == '__main__':
    main()


# Optimized solution
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]
    aset = list(set(A))
    aset.sort()

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

    for a in aset:
        for i in range(2, 10 ** 6 + 1):
            if a * i > 10 ** 6:
                break
            ans[a * i] += 1

    res = 0
    c = collections.Counter(A)
    for a in A:
        if ans[a] == 0 and c[a] == 1:
            res += 1

    print(res)



if __name__ == '__main__':
    main()
# Original solution
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]
    aset = list(set(A))
    aset.sort()

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

    for a in aset:
        for i in range(2, 10 ** 6 + 1):
            if a * i > 10 ** 6:
                break
            ans[a * i] += 1

    res = 0
    c = collections.Counter(A)
    for a in A:
        if ans[a] == 0 and c[a] == 1:
            res += 1

    print(res)



if __name__ == '__main__':
    main()


# Optimized solution
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]
    aset = list(set(A))

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

    for a in aset:
        for i in range(2, 10 ** 6 + 1):
            if a * i > 10 ** 6:
                break
            memo[a * i] += 1

    ans = 0
    c = collections.Counter(A)
    for a in A:
        # 同じ数が入っていた場合もカウントしない
        if memo[a] == 0 and c[a] == 1:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]

    A.sort()

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

    ans = 0
    for i, a in enumerate(A):
        if B[a] == 1:
            continue
        for aa in range(a, max(A) + 1, a):
            B[aa] = 1

        if i != len(A) - 1 and A[i] == A[i + 1]:
            continue

        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]

    A.sort()

    B = [0] * (A[-1] + 1)

    ans = 0
    for i, a in enumerate(A):
        if B[a] == 1:
            continue
        for aa in range(a, A[-1] + 1, a):
            B[aa] = 1

        if i != len(A) - 1 and A[i] == A[i + 1]:
            continue

        ans += 1

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]

    A.sort()

    ma = A[-1]
    B = [False] * (ma + 1)

    ans = 0
    for i, a in enumerate(A):
        if B[a]:
            continue
        for aa in range(a, ma + 1, a):
            B[aa] = True

        if i != len(A) - 1 and A[i] == A[i + 1]:
            continue

        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]

    A.sort()

    ma = A[-1]
    B = [0] * (ma + 1)

    ans = 0
    prev = 0
    for a in A:
        if B[a] == 1:
            if prev == a:
                prev = 0
                ans -= 1
            continue
        for aa in range(a, ma + 1, a):
            B[aa] = 1

        prev = a
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
from collections import Counter
n = int(eval(input()))
a = sorted([int(x) for x in input().split()])
freq = Counter(a)
A = max(a)
good = [True]*(A+1)
ans = 0
for x in freq:
	for k in range(2*x,A+1,x):
		good[k] = False
	if good[x] and freq[x]==1:
		ans += 1
print(ans)

# Optimized solution
N = int(eval(input()))
lineup = sorted([int(x) for x in input().split()])
duplicate={}
for i in lineup:
    if i in duplicate:
        duplicate[i]+=1
    else:
        duplicate[i]=1
b=max(lineup)+1
sieve=[1]*(b)
counter=0
for i in range(N):
    if sieve[lineup[i]]:
        if duplicate[lineup[i]]==1:
            counter+=1
        for j in range(lineup[i],b,lineup[i]):
            sieve[j]=0
        
print(counter)
# Original solution
N = int(eval(input()))
A = sorted((list(map(int,input().split()))))
a_Max = A[-1]
B = [0]*a_Max

for a in A:
    if B[a-1] == 0:
        B[a-1] = 1
        for j in range(2,a_Max+1):
            if a*j > a_Max:
                break
            B[a*j-1] = 2
    elif B[a-1] == 1:
        B[a-1] = 2
            
ans = 0
for b in B:
    if b == 1:
        ans += 1

print(ans)



# Optimized solution
N = int(eval(input()))
A = sorted((list(map(int,input().split()))))
a_Max = A[-1]
B = [0]*a_Max
ans =0
for a in A:
    if B[a-1] == 0:
        B[a-1] = 1
        ans += 1
        for j in range(a*2-1,a_Max,a):
            B[j] = 2
    elif B[a-1] == 1:
        B[a-1] = 2
        ans -= 1
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))

a_dic = {}
for i in a:
    if not i in a_dic:
        a_dic[i] = 0
    a_dic[i] += 1
res = 0
for i in a:
    j = 1
    flag = 1
    while j * j <= i:
        if i % j == 0:
            x = j
            if (x == i and a_dic[x] >= 2) or (x != i and x in a_dic and a_dic[x] >= 1):
                flag = 0
                break
            x = i//x
            if (x == i and a_dic[x] >= 2) or (x != i and x in a_dic and a_dic[x] >= 1):
                flag = 0
                break

        j += 1
    # print(flag)
    if flag:
        res += 1

# print(a_dic)
print(res)

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
bai = [0 for _ in range(max(a)+1)]
i = 2
for i in a:
    j = i
    while j < len(bai):
        bai[j] += 1
        j += i

res = 0
if n <= 1:
    print(n)
    exit()

for i in range(n):
    if i == 0:
        if a[i] != a[i+1] and bai[a[i]] == 1:
            res += 1
    elif i == n-1:
        if a[i] != a[i-1] and bai[a[i]] == 1:
            res += 1
    else:
        if a[i] != a[i-1] and a[i] != a[i+1] and bai[a[i]] == 1:
            res += 1

print(res)
# Original solution
def eratosthenes(a):
    data = [i for i in a]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data
    
n=int(eval(input()))
a=list(map(int, input().split()))
a.sort()
L=eratosthenes(a)
from collections import Counter
c=Counter(L)
ans=0
for v in list(c.values()):
    if v==1:
        ans+=1
print(ans)

# Optimized solution
from collections import Counter

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

m=a[-1]+1
dp=[True]*m
c=Counter(a)
ans=0
for x in a:
    if dp[x] and c[x]==1:
        ans+=1
    
    for j in range(2*x, m, x):
        dp[j]=False

print(ans)
# Original solution
def resolve():
    N = int(eval(input()))
    A = sorted(list(map(int, input().split())))
    import collections
    counter = collections.Counter(A)
    dp = [True for _ in range(max(A)+1)]
    for a in A:
        if counter[a] > 1:
            dp[a] = False
        for j in range(a+a, max(A)+1, a):
            dp[j] = False
    #print(dp)
    print((sum(1 for a in A if dp[a])))

if '__main__' == __name__:
    resolve()


# Optimized solution
def resolve():
    N = int(eval(input()))
    A = sorted(list(map(int, input().split())))
    import collections
    counter = collections.Counter(A)
    maxA = max(A)
    dp = [True for _ in range(max(A)+1)]
    for a in A:
        if counter[a] > 1:
            dp[a] = False
        for j in range(a+a, maxA+1, a):
            dp[j] = False
    #print(dp)
    print((sum(1 for a in A if dp[a])))

if '__main__' == __name__:
    resolve()
# Original solution
import sys

def input():
    return sys.stdin.readline().strip()

def main():

    N = int(eval(input()))
    A = sorted(list(map(int,input().split())))
    check = [0] * N
    ans = 0

    for i in range(N):
        if check[i] == 1:
            continue
        elif check[i] == 0 and A.count(A[i]) == 1:
            ans += 1
        for j in range(i+1,N):
            if A[j] % A[i] == 0:
                check[j] = 1
            else:
                continue
    print(ans)

if __name__ == "__main__":
    main()

# Optimized solution
import sys

def input():
    return sys.stdin.readline().strip()

def main():

    N = int(eval(input()))
    A = sorted(list(map(int,input().split())))
    A_max = A[-1] + 1
    dp = [0] * A_max

    for i in A:
        dp[i] += 1
        if dp[i] == 1:
            for j in range(i*2,A_max,i):
                dp[j] = 2
    print((dp.count(1)))

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

#定数倍のやつに＋１する
A=[0]*(max(ls)+1)
for i in range(len(ls)):
  a=1
  while ls[i]*a<=max(ls):
    b=ls[i]*a
    if A[b]<=1:
      A[b]+=1
    a+=1
    
ans=0     
for i in range(len(ls)):
  if A[ls[i]]==1:
    ans+=1
print(ans)

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

#定数倍のやつに＋１する
M=max(ls)
A=[0]*(M+1)
for i in range(N):
  a=M//ls[i]
  for j in range(1,a+1):
    if A[j*ls[i]]<=2:
      A[j*ls[i]]+=1
    
ans=0     
for i in range(len(ls)):
  if A[ls[i]]==1:
    ans+=1
print(ans)
# Original solution
N=int(eval(input()))
ls=list(map(int,input().split()))
ls.sort()

#定数倍のやつに＋１する
M=max(ls)
A=[0]*(M+1)
for i in range(N):
  a=M//ls[i]
  for j in range(1,a+1):
    A[j*ls[i]]+=1
    
ans=0     
for i in range(len(ls)):
  if A[ls[i]]==1:
    ans+=1
print(ans)

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

#定数倍のやつに＋１する
M=max(ls)
A=[0]*(M+1)
for i in range(N):
  a=M//ls[i]
  for j in range(1,a+1):
    if A[ls[i]]>=2:
      break
    else:
      A[j*ls[i]]+=1
  continue  
ans=0     
for i in range(len(ls)):
  if A[ls[i]]==1:
    ans+=1
print(ans)
# Original solution
N = int(eval(input()))
List = list(map(int, input().split()))
res = 0
List.sort()
K = List[N-1]+1
Flag = [1]*K
for i in List:
  if Flag[i] ==1:
    res +=1
    for j in range(i,K,i):
      Flag[j] = 0
    if List.count(i) > 1:
      res += -1
print(res)

# Optimized solution
N = int(eval(input()))
List = list(map(int, input().split()))
res = 0
List.sort()
K = List[N-1]+1
Flag = [1]*K
for i in range(N):
  if Flag[List[i]] ==1:
    res +=1
    for j in range(List[i],K,List[i]):
      Flag[j] = 0
    if i != N-1 and List[i] == List[i+1]:
      res += -1
print(res)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
flag = False
b = [False] * 1000010
for i in range(n - 1):
    if a[i] == a[i + 1]:
        for j in range(a[i], 1000010, a[i]):
            b[j] = True

ans = 0
for i in range(n):
    if not b[a[i]]:
        ans += 1
        for j in range(a[i], 1000010, a[i]):
            b[j] = True

print(ans)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
flag = False
b = [False] * 1000010
for i in range(n - 1):
    if a[i] == a[i + 1]:
        if b[a[i]]:
            continue
        for j in range(a[i], 1000010, a[i]):
            b[j] = True

ans = 0
for i in range(n):
    if not b[a[i]]:
        ans += 1
        for j in range(a[i], 1000010, a[i]):
            b[j] = True

print(ans)
# Original solution
n,*a=list(map(int,open(0).read().split()))
ma=1001001
nums=[0]*ma

for q in a:
  nums[q]+=1
  if nums[q]==1:
    for j in range(2*q,ma,q):
      nums[j]+=2

cnt=0
for elem in nums:
  if elem==1:
    cnt+=1
    
print(cnt)

# Optimized solution
# coding: utf-8
# Your code here!

def LI():
    return list(map(int,input().split()))
    
n=int(eval(input()))
a=LI()
a.sort()
nums=[0]*(10**6+100)
for q in a:
    if nums[q]==0:
        nums[q]=1
        for j in range(2*q,10**6+1,q):
            nums[j]+=9
    elif nums[q]==1:
        nums[q]+=9
        

cnt=0
for i in nums:
    if i==1:
        cnt+=1
print(cnt)
# Original solution
n = int(eval(input()))
a=list(map(int,input().split()))
a.sort()
dp = [True for _ in range(a[n-1])]
for val in set(a):
    for i in range(2*val,a[n-1]+1,val):
        dp[i-1]=False
ans = 0
for val in a:
    if dp[val-1] and a.count(val)==1:
        ans+=1
print(ans)

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
dp=[True]*a[-1]
def hantei(i):
    ans = True
    if i!=n-1:
        if a[i]==a[i+1]: ans = False
    if i!=0:
        if a[i]==a[i-1]: ans=False
    return ans
for val in set(a):
    for i in range(2*val,a[-1]+1,val): dp[i-1]=False
ans=0
for i in range(n):
    if dp[a[i]-1] and hantei(i)==1: ans+=1
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
remain = [0 for i in range(max(a) + 1)]
for ai in a:
    remain[ai] += 1
res = 0
for i in range(1, max(a) + 1):
    if remain[i] == 1:
        res += 1
    if remain[i]:
        for j in range(i * 2, max(a) + 1, i):
            remain[j] = 0
print(res)


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
remain = [0 for i in range(max(a) + 1)]
for ai in a:
    remain[ai] += 1
res = 0
max_a = max(a)
for i in range(1, max_a + 1):
    if remain[i] == 1:
        res += 1
    if remain[i]:
        for j in range(i * 2, max_a + 1, i):
            remain[j] = 0
print(res)
# Original solution
INF=10**6+1
n,*l=list(map(int,open(0).read().split()))
from collections import *
c=Counter(l)
l=sorted(c.keys())
a=[]
b=[0]*INF
for i in l: b[i]=1  
for i in l:
  if b[i]:
    if c[i]<2: a+=[i]
    for j in range(2*i,INF,i): b[j]=0
print((len(a)))

# Optimized solution
M=10**6+1
_,*l=list(map(int,open(0).read().split()))
b=[0]*M
for i in l: b[i]+=1
a=[]
for i in sorted(l):
  if b[i]:
    if b[i]==1: a+=[i]
    for j in range(i,M,i): b[j]=0
print((len(a)))
# Original solution
M=10**6+1
_,*l=list(map(int,open(0).read().split()))
a=[0]*M
for i in sorted(l):
  a[i]+=1
  if a[i]==1:
    for j in range(2*i,M,i): a[j]+=9
print((a.count(1)))

# Optimized solution
M=10**6+1
_,*l=list(map(int,open(0).read().split()))
a=[0]*M
for i in sorted(l):
  if a[i]: a[i]=2; continue
  for j in range(i,M,i): a[j]+=1
print((sum(a[i]==1 for i in l)))
# Original solution
M=10**6+1
_,*l=list(map(int,open(0).read().split()))
a=[0]*M
for i in l:
  if a[i]<2:
    for j in range(i,M,i): a[j]+=2
    a[i]-=1
print((a.count(1)))

# Optimized solution
M=10**6+1
_,*l=list(map(int,open(0).read().split()))
a=[0]*M
for i in l:
  if a[i]<1:
    for j in range(i*2,M,i): a[j]=2
  a[i]+=1
print((a.count(1)))
# Original solution
def div(n):
    lower_div, upper_div = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_div.append(i)
            if i != n // i:
                upper_div.append(n // i)
        i += 1
    return lower_div + upper_div[::-1]

def main():
    from collections import Counter
    n = int(eval(input()))
    A = list(map(int, input().split()))
    s = set(A)
    c = Counter(A)
    cnt = 0
    for a in A:
        if c[a] >= 2:
            continue
        else:
            d = set(div(a))
            if len(d & s) == 1:
                cnt += 1
    print(cnt)
main()


# Optimized solution
from collections import Counter
n = int(eval(input()))
A = sorted(map(int, input().split()))
M = A[-1]
c = Counter(A)
s = set()
ans = 0
for a in A:
    if a in s:
        continue
    if c[a] == 1:
        ans += 1
    i = 1
    while a * i <= M:
        s.add(a * i)
        i += 1
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
aa = [0] * (10 ** 6 + 1)
a.sort()
ans = 0


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

a = set(a)

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


print(ans)

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


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

a = set(a)

for k in a:
    for l in range(k * 2, (10 ** 6 + 1), k):
        cnt[l] += 1

for m in a:
    if cnt[m] == 1:
        ans += 1
    


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


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

a = set(a)

for k in a:
    for l in range(k * 2, (10 ** 6 + 1), k):
        cnt[l] += 1

for m in a:
    if cnt[m] == 1:
        ans += 1
    


print(ans)

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


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

a = set(a)

for k in a:
    for l in range(k * 2, (max_num), k):
        cnt[l] += 1

for m in a:
    if cnt[m] == 1:
        ans += 1
    


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

flg = [True for _ in range(10 ** 6 + 1)]
for i in range(n-1):
    if a[i] == a[i+1]:
        flg[a[i]] = False

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

    tmp = 1
    while tmp * a[i] <= 10 ** 6:
        flg[tmp * a[i]] = False
        tmp += 1

print(ans)

# Optimized solution
import sys
input = sys.stdin.readline
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()

flg = [True for _ in range(10 ** 6 + 1)]
for i in range(n-1):
    if a[i] == a[i+1]:
        flg[a[i]] = False

ans = 0
for x in set(a):
    if flg[x]:
        ans += 1

    tmp = 1
    while tmp * x <= 10 ** 6:
        flg[tmp * x] = False
        tmp += 1

print(ans)
# Original solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
a = list(map(int, input().split()))

table = [0] * (max(a) + 1)
for x in a: table[x] += 1
#print(table)
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

res = 0
for x in a:
  if table[x] > 1: continue
  for y in make_divisors(x):
    if x == y: continue
    if table[y]: break
  else: res += 1
print(res)

# Optimized solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
a = list(map(int, input().split()))
mx = max(a)
table = [0] * (mx + 1)
for x in a: table[x] += 1
#print(table)
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

res = set(a)
#print(res)
for i in range(1, mx + 1):
  if table[i] == 0: continue
  for j in range(i, mx + 1, i):
    if i == j:
      if table[j] > 1:
        res.discard(j)
      continue
    if table[j]: res.discard(j)
print((len(res)))