from collections import Counter





def main():

    N = int(eval(input()))

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

    counter = Counter(A)

    searched = [0 for _ in range(10 ** 6 + 1)]

    ans = 0

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

        if counter[i] == 0:

            continue

        if searched[i] == 0 and counter[i] == 1:

            ans += 1

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

            searched[i * j] = 1

    print(ans)





if __name__ == '__main__':

    main()
def main():

    N = int(eval(input()))

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

    counter = [0 for _ in range(10 ** 6 + 1)]

    for a in A:

        counter[a] += 1

    searched = [0 for _ in range(10 ** 6 + 1)]

    ans = 0

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

        if counter[i] == 0:

            continue

        if searched[i] == 0 and counter[i] == 1:

            ans += 1

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

            searched[i * j] = 1

    print(ans)





if __name__ == '__main__':

    main()
from collections import Counter


def main():
    N = int(eval(input()))
    A = list(map(int, input().split(" ")))
    counter = Counter(A)
    searched = [0 for _ in range(10**6 + 1)]
    ans = 0
    for i in range(1, 10**6 + 1):
        if counter[i] == 0:
            continue
        if searched[i] == 0 and counter[i] == 1:
            ans += 1
        for j in range(1, ((10**6) // i) + 1):
            searched[i * j] = 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    A = list(map(int, input().split(" ")))
    counter = [0 for _ in range(10**6 + 1)]
    for a in A:
        counter[a] += 1
    searched = [0 for _ in range(10**6 + 1)]
    ans = 0
    for i in range(1, 10**6 + 1):
        if counter[i] == 0:
            continue
        if searched[i] == 0 and counter[i] == 1:
            ans += 1
        for j in range(1, ((10**6) // i) + 1):
            searched[i * j] = 1
    print(ans)


if __name__ == "__main__":
    main()

-from collections import Counter - - -    counter = Counter(A) +    counter = [0 for _ in range(10**6 + 1)] +    for a in A: +        counter[a] += 1