CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
ok = [0]*(max(a)+1)
a.sort()

for i in range(n):
    ok[a[i]] += 1
    if ok[a[i]] == 1:
        for g in range(2*a[i], max(a)+1, a[i]):
            ok[g] += 2


print((ok.count(1)))


# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
M = max(a)
ok = [0]*(M+1)
a.sort()

for i in range(n):
    ok[a[i]] += 1
    if ok[a[i]] == 1:
        for g in range(a[i], M+1, a[i]):
            if g != a[i]:
                ok[g] += 2


print((ok.count(1)))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
M = max(a)
ok = [0]*(M+1)
a.sort()

for i in range(n):
    ok[a[i]] += 1
    if ok[a[i]] == 1:
        for g in range(a[i], M+1, a[i]):
            if g != a[i]:
                ok[g] += 2


print((ok.count(1)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
M = max(a)
ok = [0]*(M+1)
a.sort()

for i in range(n):
    ok[a[i]] += 1

for i in range(n):
    if ok[a[i]] != 0:
        for g in range(a[i], M+1, a[i]):
            if g != a[i]:
                ok[g] = 0

print((ok.count(1)))
# Original solution
n = int(eval(input()))
a = list(map(int, input().split()))
M = max(a)
ok = [0]*(M+1)
a.sort()

for i in range(n):
    ok[a[i]] += 1

for i in range(n):
    if ok[a[i]] != 0:
        for g in range(a[i], M+1, a[i]):
            if g != a[i]:
                ok[g] = 0

print((ok.count(1)))

# Optimized solution
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
MAX = a[-1]
l = [0]*(MAX+1)
for i in range(n):
    l[a[i]] += 1

ans = 0
for i in range(n):
    if l[a[i]] == 1:
        ans += 1
    for g in range(a[i], MAX+1, a[i]):
        l[g] = 10

print(ans)
# Original solution
def main():
  n=int(eval(input()))
  a=sorted(map(int,input().split()))
  tf=[1]*n
  n=n-1
#r=[]
#print(n)
#print(a)
  #notdiv=True
  #firstyn=0
  for i in range(n,-1,-1):
  #print(i)
  #notdiv=True
    if tf[i] ==0:
      continue
    for j in range(i):
    #print(a[j])
      if a[i]%a[j] == 0:
        tf[i]=0
        if a[i]==a[j]:
          for k in range(j,i):
            tf[k]=0
        break
  print((sum(tf)))
main()

# Optimized solution
def main():
  n=int(eval(input()))
  a=sorted(map(int,input().split()))
  maxa=a[-1]+1
  tf=[False]*maxa
  r=0
  n-=1
  for i in range(n):
    a_i=a[i]
    if tf[a_i] ==False:
      for j in range(a_i,maxa,a_i):
        tf[j]=True
      if a_i < a[i+1]:
        #print(a_i)
        r+=1
  if tf[-1] ==False:
    r+=1
  print(r)
main()
# Original solution
N = int(eval(input()))
A_array = list(map(int, input().split()))
ans = 0
check = [0 for _ in range(10 ** 6 + 5)]
A = A_array

for i in range(N):
  for j in range(int((len(check) - 1) / A[i])):
    check[A[i] * (j + 1)] += 1

for i in range(len(check) - 1):
  if i + 1 in A:
    if check[i + 1] == 1:
      ans += 1
    else:
      continue
  else:
    continue

print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()                  #エラトステネスの篩にかけるためソート
Amax = A[-1]
dp = [1]*(Amax+1)         #Aの最大値までのエラトステネスの篩を作る。
ans = 0
for i in range(len(A)-1):
  p = A[i]
  if dp[p] == 1:          #A[i]がA[j]の倍数でないかをエラトステネスの篩でチェック
    for q in range(Amax//p+1):
      dp[p*q] = 0         #A[i]の倍数をすべて0にする
    if A[i] != A[i+1]: 
      ans += 1            #A[i]が重複していなければカウント
if dp[Amax] == 1:         #重複チェック時にレンジオーバーするためAmaxだけ別で判定 
  ans += 1
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

ma = max(A)
Er = [0 for _ in range(ma + 5)]
is_c = [0 for _ in range(ma + 5)]

for i in range(N):
    temp = A[i]
    if Er[temp] != 2:
        a = 0
        while(1):
            a += 1
            tt = a * temp
            if tt >= ma + 5:
                break
            Er[tt] += 1
        
ans = 0
for i in range(N):
    temp = A[i]
    is_c[temp] += 1
    if is_c[temp] == 2:
        continue  
    if Er[temp] == 1:  ans += 1
        
print(ans)

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

ma = max(A)
Er = [0 for _ in range(ma + 5)]

for i in range(N):
    temp = A[i]
    if Er[temp] != 2:
        a = 0
        while(1):
            a += 1
            tt = a * temp
            if tt >= ma + 5:
                break
            Er[tt] += 1
        
ans = 0
for i in range(N):
    temp = A[i]
    if Er[temp] == 1:  ans += 1
        
print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

ma = max(A)
Er = [0 for _ in range(ma + 5)]

for i in range(N):
    temp = A[i]
    if Er[temp] != 2:
        a = 0
        while(1):
            a += 1
            tt = a * temp
            if tt >= ma + 5:
                break
            Er[tt] += 1
        
ans = 0
for i in range(N):
    temp = A[i]
    if Er[temp] == 1:  ans += 1
        
print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int,input().split()))
ma = max(A)
l = [0 for _ in range(ma + 10)]
for i in range(N):
    temp = A[i]
    while(temp <= ma + 5):
        l[temp] += 1
        temp += A[i]
ans = 0
for i in range(N):
    if l[A[i]] == 1:  ans += 1
print(ans)
# Original solution
N = int(eval(input()))
nums = [i for i in map(int, input().split(" "))]

target_count = 0
for index in range(N):
    target = nums[index]
    divisible_count = 0
    for num in nums:
        residue = target % num
        if residue ==0:
            divisible_count +=1
        if divisible_count>=2:
            break
    if divisible_count ==1:
        target_count+=1

print(target_count)

# Optimized solution
N = int(eval(input()))
nums = [i for i in map(int, input().split())]
nums = sorted(nums)
max = nums[-1]
dp = [1]*(max+1)
ans = 0

for i in range(len(nums)-1):
    p = nums[i]
    if dp[p] ==1:
        for q in range(max//p+1):
            dp[p*q]=0
        if nums[i] != nums[i+1]:
            ans+=1
if dp[max]==1:
    ans+=1
print(ans)
# Original solution
def solve():
    MAX = 1000001
    N = int(eval(input()))
    arr = list(map(int, input().split(" ")))
    arr.sort()
    is_ans = [True]*MAX
    ans = 0

    dup = set()
    for a in arr :
        if a in dup:
            j = a
            while j < MAX :
                is_ans[j] = False
                j += a

        dup.add(a)

    for a in arr :
        if is_ans[a]:
            ans += 1
            j = a
            while j < MAX :
                is_ans[j] = False
                j += a

    return ans

print((solve()))


# Optimized solution
def solve():
    MAX = 1000001
    N = int(eval(input()))
    arr = list(map(int, input().split(" ")))
    arr.sort()
    is_ans = [True]*MAX
    ans = 0

    dup = set()
    for a in arr :
        if a in dup and is_ans[a] :
            j = a
            while j < MAX :
                is_ans[j] = False
                j += a

        dup.add(a)

    for a in arr :
        if is_ans[a]:
            ans += 1
            j = a
            while j < MAX :
                is_ans[j] = False
                j += a

    return ans

print((solve()))
# Original solution
n = int(eval(input()))
ns = list(map(int, input().split()))
ans = 0
from collections import Counter
c = Counter(ns)
dubbles = set([key for key, value in list(c.items()) if value >= 2])
ns = sorted([i for i in ns if i not in dubbles])
n = len(ns)

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)
    return divisors

for i in range(n):
    flag = True
    for j in make_divisors(ns[i]):
        if j in dubbles:
            flag = False
            break
    if flag:
        ans += 1
        dubbles.add(ns[i])
print(ans)

# Optimized solution
from collections import Counter
n = int(eval(input()))
ns = list(map(int, input().split()))
c = Counter(ns)
ans = 0

l = [True] * (max(ns)+1)
for i in sorted(set(ns)):
    if l[i]:
        j = i*2
        while j < len(l):
            l[j] = False
            j += i

a = set([key for key, value in list(c.items()) if value == 1])
for i in a:
    if l[i]:
        ans += 1
print(ans)
# Original solution
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from collections import Counter
    input = sys.stdin.readline

    N = int(eval(input()))
    A = list(map(int, input().split()))
    M = 10**6

    A.sort()
    C = Counter(A)
    ans = 0
    seen = [0] * (M+1)
    for a in A:
        if C[a] == 1 and seen[a] == 0:
            ans += 1
        for j in range(1, M+1):
            if a * j > M:
                break
            seen[a*j] = 1
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from collections import Counter
    input = sys.stdin.readline

    N = int(eval(input()))
    A = list(map(int, input().split()))
    M = 10**6

    A.sort()
    C = Counter(A)
    ans = 0
    seen = [0] * (M+1)
    A = set(A)
    for a in A:
        if C[a] == 1 and seen[a] == 0:
            ans += 1
        for j in range(1, M+1):
            if a * j > M:
                break
            seen[a*j] = 1
    print(ans)


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


def main():
    N = int(eval(input()))
    A = list(map(int, input().split(' ')))
    counter = Counter(A)
    searched = [0 for _ in range(10 ** 6 + 1)]
    ans = 0
    for i in range(1, 10 ** 6 + 1):
        if counter[i] == 0:
            continue
        if searched[i] == 0 and counter[i] == 1:
            ans += 1
        for j in range(1, ((10 ** 6) // i) + 1):
            searched[i * j] = 1
    print(ans)


if __name__ == '__main__':
    main()

# Optimized solution
def main():
    N = int(eval(input()))
    A = list(map(int, input().split(' ')))
    counter = [0 for _ in range(10 ** 6 + 1)]
    for a in A:
        counter[a] += 1
    searched = [0 for _ in range(10 ** 6 + 1)]
    ans = 0
    for i in range(1, 10 ** 6 + 1):
        if counter[i] == 0:
            continue
        if searched[i] == 0 and counter[i] == 1:
            ans += 1
        for j in range(1, ((10 ** 6) // i) + 1):
            searched[i * j] = 1
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
def fact(x):
    i = 1
    while i * i <= x:
        if x % i == 0:
            yield i
            yield x // i
        i += 1


def main():
    n = int(eval(input()))
    a = tuple(map(int, input().split()))
    if a.count(10 ** 6) == n:
        print((0))
        exit()

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

    for e in a:
        c[e] += 1

    ans = n
    for e in a:
        c[e] -= 1
        for fct in fact(e):
            if c[fct]:
                ans -= 1
                break

        c[e] += 1

    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
from time import time


def fact(x):
    i = 1
    while i * i <= x:
        if x % i == 0:
            yield i
            yield x // i
        i += 1


def main():
    n = int(eval(input()))
    a = tuple(map(int, input().split()))
    now = time()

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

    for e in a:
        c[e] += 1

    ans = n
    for e in a:
        c[e] -= 1
        for fct in fact(e):
            if c[fct]:
                ans -= 1
                break

        if time() - now >= 1.8:
            print(n)
            exit()

        c[e] += 1

    print(ans)


if __name__ == "__main__":
    main()
# Original solution
n=int(eval(input()))
a=sorted(map(int,input().split()),reverse=True)
t=[0]*1000001
for i in a:
    t[i]+=1
    for j in range(i*2,1000001,i):
        t[j]+=2
print((t.count(1)))

# Optimized solution

n=int(eval(input()))
a=sorted(map(int,input().split()))
m=max(a)+1
t=[0]*m
cnt=0
for i in a:
    if t[i]==0:
        cnt+=1
    elif t[i]==1:
        cnt-=1
    if t[i]<2:
        t[i]+=1
        for j in range(i*2,m,i):
            t[j]=2
print(cnt)
# Original solution
n = int(eval(input()))
A = list(map(int,input().split()))
A = sorted(A)

limit = 10**6 + 2
A += [limit]
dp = [True] * (limit)

ans = 0
for i in range(n):
  a = A[i]
  if dp[a] and a != A[i+1]:
    ans += 1

  for t in range(a,limit,a):    
    dp[t] = False
    t += a

print(ans)    

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

limit = 10**6 + 2
A += [limit]
dp = [True] * (limit)

ans = 0
for i in range(n):
  a = A[i]
  if dp[a] and a != A[i+1]:
    ans += 1
  
  if dp[a] == False:
    continue
  for t in range(a,limit,a):    
    dp[t] = False
    t += a

print(ans)
# Original solution
n = int(eval(input()))
a = [int(i) for i in input().split(" ")]

a.sort()
dp = [True for i in range(n)]

for i in range(n):
    if dp[i]:
        for j in range(i + 1, n):
            if not a[j] % a[i]:
                dp[j] = False
            if a[j] == a[i]:
                dp[i] = False

print((dp.count(True)))

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

a.sort()
dp = [True for i in range(a[-1]+1)]
count=0

for i in range(n):
    if dp[a[i]]:
        count+=1
        for j in range(1,n-i):
            if a[i]!=a[i+j]:
                break
            elif j==1:
                count-=1
            dp[a[i+j]]=False
        for j in range(a[i], a[-1]+1, a[i]):
            dp[j]=False
        # for j in range(i + 1, n):
        #     if not a[j] % a[i]:
        #         dp[j] = False
        #     if a[j] == a[i]:
        #         dp[i] = False

#print(dp.count(True))
print(count)
# Original solution
from math import gcd as bltin_gcd
def coprime(a, b):
    return bltin_gcd(a, b) == 1

n=int(eval(input()))
a=list(map(int,input().split()))
ans=0
for i in range(n):
    cnt=0
    for j in range(n):
        if i!=j:
            if a[i]%a[j]==0:
                cnt+=1
    if cnt==0:
        ans+=1
print(ans)


# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
aMax=a[-1]
isAns=[0]*(aMax+1) ## 1=ans 2=multiple or plural
for ai in a:
    isAns[ai]+=1
    if isAns[ai]==1:
      for j in range(2*ai,aMax+1,ai):
        isAns[j]+=2

print((isAns.count(1)))
# Original solution
from sys import stdin
input = stdin.readline
I = lambda :list(map(int,input().split()))

n,=I()
l = sorted(I())
g=[0]*(10**6+1)
an=0;p=l[-1]
if l[0]==1:
  print((1 if n==1 else int(l[1]!=1)));exit()
for i in range(n):
  x=l[i];f=1
  for j in range(1,int(x**0.5)+1):
    if x%j==0:
      if g[j] or g[x//j]:
        f=0;break
  for j in range(x,p+1,x):
  	g[j]=1
  if f and (i!=n-1 and l[i+1]!=l[i]):
    an+=1
  elif f and i==n-1:
    an+=1
print(an)

# Optimized solution
n,a=int(eval(input())),sorted(list(map(int,input().split())))
m,s=a[-1],[0]*(a[-1]+1)
for i in a:
  s[i]+=1
for i in set(a):
	if s[i]:
		for j in range(i*2,m+1,i):s[j]=0
print((s.count(1)))
# Original solution
def main():
    n=int(eval(input()))
    a=list(map(int, input().split()))
    a.sort()
    arr=[0]*(10**6+1)
    flag=[True]*(10**6+1)
    ans=0
    for i in range(n):
        if flag[a[i]]:
            arr[a[i]]+=1
            for j in range(a[i]*2,10**6+1,a[i]):
                flag[j]=False
    print((arr.count(1)))
main()

# Optimized solution
import sys
input = sys.stdin.readline
n=int(eval(input()))
a=list(map(int, input().split()))
a.sort()
m=max(a)
arr=[0]*(m+1)
flag=[True]*(m+1)
ans=0
for i in range(n):
    if flag[a[i]]:
        arr[a[i]]+=1
        if not arr[a[i]]==1:
            continue
        for j in range(a[i]*2,m+1,a[i]):
            flag[j]=False
print((arr.count(1)))
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
A.sort(reverse=True)
max_a=A[0]
dp=[True]*(max_a+1)
ans=0
for i in range(N):
  a=A.pop()
  #print(a)
  if dp[a]==True: 
    if a not in A:
      ans+=1
    k=a
    while k<=max_a:
      dp[k]=False    
      k+=a
print(ans)

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
A.sort()
max_a=A[-1]
dp=[True]*(max_a+1)
ans=0
for i in range(N):
  a=A[i]
  #print(a)
  if dp[a]==True: 
    if i==N-1:
      ans+=1
    elif a!=A[i+1]:
      ans+=1
    
    k=a
    while k<=max_a:
      dp[k]=False    
      k+=a
print(ans)
# Original solution

def s0():return eval(input())
def s1():return input().split()
def s2(n):return [eval(input()) for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(eval(input()))
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(eval(input())) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print((yes if b else no))
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
n=n0()
A=n1()

A.sort()
A=deque(A)
d=defaultdict(int)
for j in A:
    d[j]+=1     

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

ans=0
while len(A)>0:
    a=A.popleft()
    l=make_divisors(a)

    for i in l:
        if i==a:
            if d[i]>1:
                break
        elif d[i]>0:
            break
    else:
        ans+=1
print(ans)

# Optimized solution

def s0():return eval(input())
def s1():return input().split()
def s2(n):return [eval(input()) for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(eval(input()))
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(eval(input())) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print((yes if b else no))
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
n=n0()
A=n1()

A.sort()
m=A[-1]

d=defaultdict(int)
d2=defaultdict(int)

for i in A:
    d2[i]+=1

ans=0
for a in A:
    if d[a]==0:
        if d2[a]<=1:
            ans+=1
        i=a
        while i<=m:
            d[i]=1
            i+=a
print(ans)
# Original solution
from collections import deque
import math

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

    A.sort()

    Amax=max(A)

    dp=[0]*Amax

    tmp=-1
    res=0
    for i in range(len(A)):
        a=A.pop(0)
        if a==tmp:
            continue
        if dp[a-1]==0:
            if len(A)>0:
                if A[0]!=a:
                    res+=1
            else:
                res+=1
            m=2
            while (a*m)<=Amax:
                dp[a*m-1]=1
                m+=1
        tmp=a

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

# Optimized solution
from collections import deque
import math

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

    A.sort(reverse=True)

    Amax=max(A)

    dp=[0]*Amax

    tmp=-1
    res=0
    for i in range(len(A)):
        a=A.pop()
        if a==tmp:
            continue
        if dp[a-1]==0:
            if len(A)>0:
                if A[len(A)-1]!=a:
                    res+=1
            else:
                res+=1
            m=2
            while (a*m)<=Amax:
                dp[a*m-1]=1
                m+=1
        tmp=a

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

is_prime = [True] * (10**6 + 1)
pre_a = 0
for a in A:
    if a == pre_a:
        is_prime[a] = False
    j = 2 * a
    while j <= 10**6:
        is_prime[j] = False
        j += a
    
    pre_a = a

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

print(ans)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
S = set(A)
M = max(A)
A.sort()

pre_a = 0
for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a

print((len(S)))
# Original solution
# エラトステネスの篩を使う！O(nloglogn)
N = int(eval(input()))
A = list(map(int,input().split()))

listA = [0] * (10**6+10)
ans = 0
for i in A:
    for j in range(i,10**6+10,i):
        if listA[j] != 0:
            listA[j] = 2
            continue
        else:
            listA[j] += 1

for i in A:
    if listA[i] == 1:
        ans += 1

print(ans)


# Optimized solution
# エラトステネスの篩を使う！O(nloglogn)
N = int(eval(input()))
A = list(map(int,input().split()))

listA = [0] * (10**6+10)
ans = 0
for i in A:
    if listA[i] != 0:
            listA[i] = 2
            continue
    for j in range(i,10**6+10,i):
        listA[j] += 1

for i in A:
    if listA[i] == 1:
        ans += 1

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

import math
ans=0
for i in range(n):
    check=True
    for k in range(i):
        if A[k]/2>(A[i]):
            break
        if A[i]%A[k]==0:
            check=False
            break
    if i!=n-1:
        if A[i]==A[i+1]:
            check=False
    if check:
        ans+=1


print(ans)



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

box=[True]*(A[-1]+1)

for i in range(len(A)):
    if i<n-1 and A[i]==A[i+1]:
        box[A[i]]=False
    k=2
    while A[i]*k<len(box):
        box[A[i]*k]=False
        k+=1

ans=0
for i in A:
    if box[i]:
        ans+=1
print(ans)
# Original solution
from sys import stdin
 
N = int(stdin.readline().strip())
A = [int(x) for x in stdin.readline().strip().split(" ")]

sum_num = 0

for i in range(len(A)):
    tmp = [A[i]] * N
    tmp = [x % y for (x, y) in zip(tmp, A)]
    tmp[i] = 1
    if 0 not in tmp:
        sum_num += 1

print(sum_num)


# Optimized solution
from sys import stdin
 
N = int(eval(input()))
A = sorted(int(x) for x in input().split())
max_num = A[-1] + 1
count = [0] * max_num

for i in A:
    if count[i] != 0:
        count[i] = 2
        continue
    else:
        for j in range(i, max_num, i):
            count[j] += 1

sum_num = sum(count[i] == 1 for i in A)
print(sum_num)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
dp = [True] * (A[-1]+1)

for i,num in enumerate(A):
    if i < N-1 and A[i+1] == num:
        dp[num] = False
    for j in range(2*num, A[-1]+1, num):
        dp[j] = False

print((len([i for i in A if dp[i]])))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
dp = [True] * (A[-1]+1)

for i,num in enumerate(A):
    if i < N-1 and A[i+1] == num:
        dp[num] = False
    else:
        for j in range(2*num, A[-1]+1, num):
            dp[j] = False

print((len([i for i in A if dp[i]])))
# Original solution
n = int(eval(input()))
a = sorted(list(map(int,input().split())))

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

ans = 0
div = []
for i in range(n):
    if 0 < i and a[i] == a[i-1]:
        if i < n-1 and a[i] != a[i+1]:
            div += [a[i]]
        continue
    if i < n-1 and a[i] == a[i+1]:
        continue

    b = True
    for x in div:
        if a[i] < x * 2:
            break
        if a[i] % x == 0:
            b = False
    if b:
        ans += 1
        div += [a[i]]

print(ans)

# Optimized solution
n = int(eval(input()))
a = sorted(list(map(int,input().split())))
m = a[-1]
b = [True]*(m+1)
for i in range(n):
    if i > 0 and a[i] == a[i-1]:
        continue
    for j in range(2, m//a[i]+1):
        b[j*a[i]] = False
ans = 0
for i in range(n):
    if 0 < i and a[i] == a[i-1]:
        continue
    if i < n-1 and a[i] == a[i+1]:
        continue
    if b[a[i]]:
        ans += 1
print(ans)