def main():

    import sys

    input = sys.stdin.buffer.readline

    N = int(eval(input()))

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

    A.sort()

    B = [True]*(10**6+1)



    from collections import Counter

    c = Counter(A)

    bl = set()

    for k, v in list(c.items()):

        if v >= 2:

            bl.add(k)



    ans = 0

    for a in set(A):

        if a not in bl and B[a]:

            ans += 1

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

            if 10**6 < a*i:

                break

            B[a*i] = False

    print(ans)





if __name__ == '__main__':

    main()

def main():

    import sys

    input = sys.stdin.buffer.readline

    N = int(eval(input()))

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

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

    for a in A:

        B[a] += 1



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

        if not B[i]:

            continue

        j = 2*i

        while j <= 10**6:

            B[j] += 1

            j += i

    ans = 0

    for a in A:

        if B[a] <= 1:

            ans += 1

    print(ans)





if __name__ == '__main__':

    main()

def main():
    import sys

    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    A.sort()
    B = [True] * (10**6 + 1)
    from collections import Counter

    c = Counter(A)
    bl = set()
    for k, v in list(c.items()):
        if v >= 2:
            bl.add(k)
    ans = 0
    for a in set(A):
        if a not in bl and B[a]:
            ans += 1
        for i in range(1, 10**6):
            if 10**6 < a * i:
                break
            B[a * i] = False
    print(ans)


if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    B = [0] * (10**6 + 1)
    for a in A:
        B[a] += 1
    for i in range(1, 10**6):
        if not B[i]:
            continue
        j = 2 * i
        while j <= 10**6:
            B[j] += 1
            j += i
    ans = 0
    for a in A:
        if B[a] <= 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-    A.sort() -    B = [True] * (10**6 + 1) -    from collections import Counter - -    c = Counter(A) -    bl = set() -    for k, v in list(c.items()): -        if v >= 2: -            bl.add(k) +    B = [0] * (10**6 + 1) +    for a in A: +        B[a] += 1 +    for i in range(1, 10**6): +        if not B[i]: +            continue +        j = 2 * i +        while j <= 10**6: +            B[j] += 1 +            j += i -    for a in set(A): -        if a not in bl and B[a]: +    for a in A: +        if B[a] <= 1: -        for i in range(1, 10**6): -            if 10**6 < a * i: -                break -            B[a * i] = False