#!python3.8

# -*- coding: utf-8 -*-

# abc170/abc170_d

from collections import Counter



def main():

    N = eval(input())

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

    B = Counter(A)

    for a in A:

        if B[a] == 0:

            continue

        if B[a] > 1:

            B[a] = 0

        for i in range(2, A[-1] // a + 1):

            B[a * i] = 0

    print((Counter(list(B.values()))[1]))

    return



main()

#!python3.8

# -*- coding: utf-8 -*-

# abc170/abc170_d

from collections import Counter



def main():

    N = eval(input())

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

    B = Counter(A)

    for a in A:

        if B[a] == 0:

            continue

        if B[a] > 1:

            B[a] = 0

        for i in range(2, A[-1] // a + 1):

            if B[a * i]:

                B[a * i] = 0

    print((sum(B.values())))

    return



main()

#!python3.8
# -*- coding: utf-8 -*-
# abc170/abc170_d
from collections import Counter


def main():
    N = eval(input())
    A = sorted(map(int, input().split(" ")))
    B = Counter(A)
    for a in A:
        if B[a] == 0:
            continue
        if B[a] > 1:
            B[a] = 0
        for i in range(2, A[-1] // a + 1):
            B[a * i] = 0
    print((Counter(list(B.values()))[1]))
    return


main()

#!python3.8
# -*- coding: utf-8 -*-
# abc170/abc170_d
from collections import Counter


def main():
    N = eval(input())
    A = sorted(map(int, input().split(" ")))
    B = Counter(A)
    for a in A:
        if B[a] == 0:
            continue
        if B[a] > 1:
            B[a] = 0
        for i in range(2, A[-1] // a + 1):
            if B[a * i]:
                B[a * i] = 0
    print((sum(B.values())))
    return


main()

-            B[a * i] = 0 -    print((Counter(list(B.values()))[1])) +            if B[a * i]: +                B[a * i] = 0 +    print((sum(B.values())))