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()

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(aa,lim,aa):



                tmp[j] = 1



            if cnt[aa] == 1:

                # print(aa, ans)

                ans += 1









    print(ans)



if __name__=='__main__':

    main()

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()

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(aa, lim, aa):
                tmp[j] = 1
            if cnt[aa] == 1:
                # print(aa, ans)
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-            for j in range(lim): -                if aa * j > lim - 1: -                    break -                tmp[aa * j] = 1 +            for j in range(aa, lim, aa): +                tmp[j] = 1