from math import sqrt

from collections import Counter





def main():

    N = int(eval(input()))

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



    ans = 0

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

    c = Counter(A)



    for a in list(c.keys()):

        tmp = a * 2

        while tmp <= 10**6:

            p[tmp] = 1

            tmp += a



    for a in A:

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

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()

from math import sqrt

from collections import Counter





def main():

    N = int(eval(input()))

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

    A.sort()



    ans = 0

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

    c = Counter(A)



    for a in list(c.keys()):

        tmp = a * 2

        while tmp <= 10**6:

            p[tmp] = 1

            tmp += a



    for a in A:

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

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()

from math import sqrt
from collections import Counter


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    ans = 0
    p = [0] * (10**6 + 1)
    c = Counter(A)
    for a in list(c.keys()):
        tmp = a * 2
        while tmp <= 10**6:
            p[tmp] = 1
            tmp += a
    for a in A:
        if p[a] == 0 and c[a] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

from math import sqrt
from collections import Counter


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A.sort()
    ans = 0
    p = [0] * (10**6 + 1)
    c = Counter(A)
    for a in list(c.keys()):
        tmp = a * 2
        while tmp <= 10**6:
            p[tmp] = 1
            tmp += a
    for a in A:
        if p[a] == 0 and c[a] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

+    A.sort()