from collections import Counter

import bisect

N = int(eval(input()))

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

cnt = Counter(A)

A.sort()

ans = 0

MX = 10**6

P = [0] * (MX+1)

for a in A:

    if P[a]==0:

        for i in range(MX+1):

            x = a*i

            if x > MX:

                break

            P[x] = 1

        if cnt[a]==1:

            ans+=1

print (ans)
def main():

    n = int(eval(input()))

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



    ans = 0

    from collections import Counter

    cnt = Counter(a)

    lim = max(a) + 1

    tmp = [0] * (lim)

    # set_a = list(set(a))

    # set_a.sort()

    a.sort()



    for aa in a:

        if tmp[aa] == 0:

            for j in range(lim):

                if aa * j > lim-1:

                    break

                tmp[aa*j] = 1



            if cnt[aa] == 1:

                # print(aa, ans)

                ans += 1









    print(ans)



if __name__=='__main__':

    main()

from collections import Counter
import bisect

N = int(eval(input()))
A = list(map(int, input().split()))
cnt = Counter(A)
A.sort()
ans = 0
MX = 10**6
P = [0] * (MX + 1)
for a in A:
    if P[a] == 0:
        for i in range(MX + 1):
            x = a * i
            if x > MX:
                break
            P[x] = 1
        if cnt[a] == 1:
            ans += 1
print(ans)

def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    ans = 0
    from collections import Counter

    cnt = Counter(a)
    lim = max(a) + 1
    tmp = [0] * (lim)
    # set_a = list(set(a))
    # set_a.sort()
    a.sort()
    for aa in a:
        if tmp[aa] == 0:
            for j in range(lim):
                if aa * j > lim - 1:
                    break
                tmp[aa * j] = 1
            if cnt[aa] == 1:
                # print(aa, ans)
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-from collections import Counter -import bisect +def main(): +    n = int(eval(input())) +    a = list(map(int, input().split())) +    ans = 0 +    from collections import Counter -N = int(eval(input())) -A = list(map(int, input().split())) -cnt = Counter(A) -A.sort() -ans = 0 -MX = 10**6 -P = [0] * (MX + 1) -for a in A: -    if P[a] == 0: -        for i in range(MX + 1): -            x = a * i -            if x > MX: -                break -            P[x] = 1 -        if cnt[a] == 1: -            ans += 1 -print(ans) +    cnt = Counter(a) +    lim = max(a) + 1 +    tmp = [0] * (lim) +    # set_a = list(set(a)) +    # set_a.sort() +    a.sort() +    for aa in a: +        if tmp[aa] == 0: +            for j in range(lim): +                if aa * j > lim - 1: +                    break +                tmp[aa * j] = 1 +            if cnt[aa] == 1: +                # print(aa, ans) +                ans += 1 +    print(ans) + + +if __name__ == "__main__": +    main()