from collections import Counter

n=int(eval(input()))

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

sa=Counter(a)



if 1 in sa:

    if sa[1]>1:

        print((0))

    else:

        print((1))

    exit()



# def fct(x):

#     f1=[1]

#     f2=[]

#     for i in range(2,min(int(x**(1/2)+7),x)):

#         if x%i==0:

#             f1.append(i)

#             f2.append(x//i)

#     return (set(f1+f2))

ans=0

for ai in sa:

    if sa[ai]>1:

        continue

    

    ans+=1

    if ai%2==0:

        for i in range(2,min(int(ai**(1/2)+7),ai)):

            if ai%i==0:

                if i in sa or ai//i in sa:

                    ans-=1

                    break

    else:

        for i in range(3,min(int(ai**(1/2)+7),ai),2):

            if ai%i==0:

                if i in sa or ai//i in sa:

                    ans-=1

                    break

print(ans)

##想定解



n=int(eval(input()))

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



from collections import Counter



ca=Counter(a)



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





for ai in ca:

    nn[ai]=ca[ai]



ans=0

for i in range(10**6+1):

    if nn[i]==1:

        ans+=1

    if nn[i]:

        for j in range(2*i,10**6+1,i):

            nn[j]=0

print(ans)

from collections import Counter

n = int(eval(input()))
(*a,) = list(map(int, input().split()))
sa = Counter(a)
if 1 in sa:
    if sa[1] > 1:
        print((0))
    else:
        print((1))
    exit()
# def fct(x):
#     f1=[1]
#     f2=[]
#     for i in range(2,min(int(x**(1/2)+7),x)):
#         if x%i==0:
#             f1.append(i)
#             f2.append(x//i)
#     return (set(f1+f2))
ans = 0
for ai in sa:
    if sa[ai] > 1:
        continue
    ans += 1
    if ai % 2 == 0:
        for i in range(2, min(int(ai ** (1 / 2) + 7), ai)):
            if ai % i == 0:
                if i in sa or ai // i in sa:
                    ans -= 1
                    break
    else:
        for i in range(3, min(int(ai ** (1 / 2) + 7), ai), 2):
            if ai % i == 0:
                if i in sa or ai // i in sa:
                    ans -= 1
                    break
print(ans)

##想定解
n = int(eval(input()))
(*a,) = list(map(int, input().split()))
from collections import Counter

ca = Counter(a)
nn = [0] * (10**6 + 1)
for ai in ca:
    nn[ai] = ca[ai]
ans = 0
for i in range(10**6 + 1):
    if nn[i] == 1:
        ans += 1
    if nn[i]:
        for j in range(2 * i, 10**6 + 1, i):
            nn[j] = 0
print(ans)

+##想定解 +n = int(eval(input())) +(*a,) = list(map(int, input().split())) -n = int(eval(input())) -(*a,) = list(map(int, input().split())) -sa = Counter(a) -if 1 in sa: -    if sa[1] > 1: -        print((0)) -    else: -        print((1)) -    exit() -# def fct(x): -#     f1=[1] -#     f2=[] -#     for i in range(2,min(int(x**(1/2)+7),x)): -#         if x%i==0: -#             f1.append(i) -#             f2.append(x//i) -#     return (set(f1+f2)) +ca = Counter(a) +nn = [0] * (10**6 + 1) +for ai in ca: +    nn[ai] = ca[ai] -for ai in sa: -    if sa[ai] > 1: -        continue -    ans += 1 -    if ai % 2 == 0: -        for i in range(2, min(int(ai ** (1 / 2) + 7), ai)): -            if ai % i == 0: -                if i in sa or ai // i in sa: -                    ans -= 1 -                    break -    else: -        for i in range(3, min(int(ai ** (1 / 2) + 7), ai), 2): -            if ai % i == 0: -                if i in sa or ai // i in sa: -                    ans -= 1 -                    break +for i in range(10**6 + 1): +    if nn[i] == 1: +        ans += 1 +    if nn[i]: +        for j in range(2 * i, 10**6 + 1, i): +            nn[j] = 0