from sys import stdin



def main():

    from collections import defaultdict

    input = stdin.readline



    n = int(eval(input()))

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

    p = defaultdict(int)

    for x in a:

        p[x] += 1

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

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

        if v > 1:

            f[k] = False

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

            f[i] = False

    print((sum(1 for x in a if f[x])))

main()
from sys import stdin



def main():

    from collections import defaultdict

    input = stdin.readline



    n = int(eval(input()))

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

    p = defaultdict(int)

    for x in a:

        p[x] += 1

    q = a[-1] + 1

    f = [True] * (q)

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

        if v > 1:

            f[k] = False

        for i in range(k + k, q, k):

            f[i] = False

    print((sum(1 for x in a if f[x])))

main()
from sys import stdin


def main():
    from collections import defaultdict

    input = stdin.readline
    n = int(eval(input()))
    a = sorted(list(map(int, input().split())))
    p = defaultdict(int)
    for x in a:
        p[x] += 1
    f = [True] * (10**6 + 1)
    for k, v in list(p.items()):
        if v > 1:
            f[k] = False
        for i in range(k + k, 10**6 + 1, k):
            f[i] = False
    print((sum(1 for x in a if f[x])))


main()

from sys import stdin


def main():
    from collections import defaultdict

    input = stdin.readline
    n = int(eval(input()))
    a = sorted(list(map(int, input().split())))
    p = defaultdict(int)
    for x in a:
        p[x] += 1
    q = a[-1] + 1
    f = [True] * (q)
    for k, v in list(p.items()):
        if v > 1:
            f[k] = False
        for i in range(k + k, q, k):
            f[i] = False
    print((sum(1 for x in a if f[x])))


main()

-    f = [True] * (10**6 + 1) +    q = a[-1] + 1 +    f = [True] * (q) -        for i in range(k + k, 10**6 + 1, k): +        for i in range(k + k, q, k):