from sys import stdin

from sys import setrecursionlimit

from collections import Counter

from numba import jit



setrecursionlimit(10 ** 7)



n = int(stdin.readline().rstrip())

a = list(map(int,stdin.readline().rstrip().split()))

a.sort()

b = list(set(a))

b.sort()

c = Counter(a)



se = set()



@jit

def make_divisors(n):

    lower_divisors , upper_divisors = [], []

    i = 1

    while i*i <= n:

        if n % i == 0:

            lower_divisors.append(i)

            if i != n // i:

                upper_divisors.append(n//i)

        i += 1

    return lower_divisors + upper_divisors[::-1]



for i in b:

    k = make_divisors(i)

    flag = True

    for j in k:

        if j in se:

            flag = False

            break

    if flag:

        se.add(i)



point = len(se)



for i in se:

    if c[i] > 1:

        point -= 1



print(point)
import numpy as np

from collections import Counter



n = int(eval(input()))

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

a.sort()



dp = [0]*(a[-1]+1)

dp = np.array(dp,int)



for i in a:

    dp[i] = 1



for i in a:

    if dp[i] == 1:

        dp[2*i::i] = 0



c = Counter(a)



for i,j in list(c.items()):

    if j > 1:

        dp[i] = 0



print((dp.sum()))
from sys import stdin
from sys import setrecursionlimit
from collections import Counter
from numba import jit

setrecursionlimit(10**7)
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))
a.sort()
b = list(set(a))
b.sort()
c = Counter(a)
se = set()


@jit
def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n // i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


for i in b:
    k = make_divisors(i)
    flag = True
    for j in k:
        if j in se:
            flag = False
            break
    if flag:
        se.add(i)
point = len(se)
for i in se:
    if c[i] > 1:
        point -= 1
print(point)

import numpy as np
from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
dp = [0] * (a[-1] + 1)
dp = np.array(dp, int)
for i in a:
    dp[i] = 1
for i in a:
    if dp[i] == 1:
        dp[2 * i :: i] = 0
c = Counter(a)
for i, j in list(c.items()):
    if j > 1:
        dp[i] = 0
print((dp.sum()))

-from sys import stdin -from sys import setrecursionlimit +import numpy as np -from numba import jit -setrecursionlimit(10**7) -n = int(stdin.readline().rstrip()) -a = list(map(int, stdin.readline().rstrip().split())) +n = int(eval(input())) +a = list(map(int, input().split())) -b = list(set(a)) -b.sort() +dp = [0] * (a[-1] + 1) +dp = np.array(dp, int) +for i in a: +    dp[i] = 1 +for i in a: +    if dp[i] == 1: +        dp[2 * i :: i] = 0 -se = set() - - -@jit -def make_divisors(n): -    lower_divisors, upper_divisors = [], [] -    i = 1 -    while i * i <= n: -        if n % i == 0: -            lower_divisors.append(i) -            if i != n // i: -                upper_divisors.append(n // i) -        i += 1 -    return lower_divisors + upper_divisors[::-1] - - -for i in b: -    k = make_divisors(i) -    flag = True -    for j in k: -        if j in se: -            flag = False -            break -    if flag: -        se.add(i) -point = len(se) -for i in se: -    if c[i] > 1: -        point -= 1 -print(point) +for i, j in list(c.items()): +    if j > 1: +        dp[i] = 0 +print((dp.sum()))