import numpy as np

n=int(eval(input()))

a=[int(j)for j in input().split()]+[10**7]

l=np.zeros(max(a)+1)

a.sort()

r=0

for i,j in zip(a,a[1:]):

    if l[i]==0:

        l[::i]=1

        if i!=j:

            r+=1

print(r)
import numpy as np

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

l=np.zeros(max(a)+1)

a.sort()

a+=[10**7]

r=0

for i,j in zip(a,a[1:]):

    if l[i]==0:

        l[::i]=1

        if i!=j:

            r+=1

print(r)
import numpy as np

n = int(eval(input()))
a = [int(j) for j in input().split()] + [10**7]
l = np.zeros(max(a) + 1)
a.sort()
r = 0
for i, j in zip(a, a[1:]):
    if l[i] == 0:
        l[::i] = 1
        if i != j:
            r += 1
print(r)

import numpy as np

n, *a = list(map(int, open(0).read().split()))
l = np.zeros(max(a) + 1)
a.sort()
a += [10**7]
r = 0
for i, j in zip(a, a[1:]):
    if l[i] == 0:
        l[::i] = 1
        if i != j:
            r += 1
print(r)

-n = int(eval(input())) -a = [int(j) for j in input().split()] + [10**7] +n, *a = list(map(int, open(0).read().split())) +a += [10**7]