import sys

import collections



sys.setrecursionlimit(10 ** 8)



input = sys.stdin.readline





def main():

    N = int(eval(input()))

    A = [int(x) for x in input().split()]

    aset = list(set(A))

    aset.sort()



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



    for a in aset:

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

            if a * i > 10 ** 6:

                break

            ans[a * i] += 1



    res = 0

    c = collections.Counter(A)

    for a in A:

        if ans[a] == 0 and c[a] == 1:

            res += 1



    print(res)







if __name__ == '__main__':

    main()

import sys

import collections



sys.setrecursionlimit(10 ** 8)



input = sys.stdin.readline





def main():

    N = int(eval(input()))

    A = [int(x) for x in input().split()]

    aset = list(set(A))



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



    for a in aset:

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

            if a * i > 10 ** 6:

                break

            memo[a * i] += 1



    ans = 0

    c = collections.Counter(A)

    for a in A:

        # 同じ数が入っていた場合もカウントしない

        if memo[a] == 0 and c[a] == 1:

            ans += 1



    print(ans)





if __name__ == '__main__':

    main()

import sys
import collections

sys.setrecursionlimit(10**8)
input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]
    aset = list(set(A))
    aset.sort()
    ans = [0] * (10**6 + 1)
    for a in aset:
        for i in range(2, 10**6 + 1):
            if a * i > 10**6:
                break
            ans[a * i] += 1
    res = 0
    c = collections.Counter(A)
    for a in A:
        if ans[a] == 0 and c[a] == 1:
            res += 1
    print(res)


if __name__ == "__main__":
    main()

import sys
import collections

sys.setrecursionlimit(10**8)
input = sys.stdin.readline


def main():
    N = int(eval(input()))
    A = [int(x) for x in input().split()]
    aset = list(set(A))
    memo = [0] * (10**6 + 1)
    for a in aset:
        for i in range(2, 10**6 + 1):
            if a * i > 10**6:
                break
            memo[a * i] += 1
    ans = 0
    c = collections.Counter(A)
    for a in A:
        # 同じ数が入っていた場合もカウントしない
        if memo[a] == 0 and c[a] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-    aset.sort() -    ans = [0] * (10**6 + 1) +    memo = [0] * (10**6 + 1) -            ans[a * i] += 1 -    res = 0 +            memo[a * i] += 1 +    ans = 0 -        if ans[a] == 0 and c[a] == 1: -            res += 1 -    print(res) +        # 同じ数が入っていた場合もカウントしない +        if memo[a] == 0 and c[a] == 1: +            ans += 1 +    print(ans)