from numba import njit, int32

import numpy as np





@njit(int32(int32[:], int32[:]))

def main(A, B):

    ans = 0



    for a in A:

        B[a] += 1



    for a in set(A):

        v = 2*a

        while v <= 10**6:

            B[v] += 1

            v += a



    for a in A:

        if B[a] == 1:

            ans += 1



    return ans





if __name__ == '__main__':

    N = int(eval(input()))

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

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

    ans = main(np.array(A, dtype=np.int32), np.array(B, dtype=np.int32))

    print(ans)

from numba import njit, int32

import numpy as np





@njit(int32(int32[:], int32[:], int32[:]))

def main(A, B, C):

    ans = 0



    for a in A:

        B[a] += 1



    for a in C:

        v = 2*a

        while v <= 10**6:

            B[v] += 1

            v += a



    for a in A:

        if B[a] == 1:

            ans += 1



    return ans





if __name__ == '__main__':

    N = int(eval(input()))

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

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

    ans = main(np.array(A, dtype=np.int32),

               np.array(B, dtype=np.int32),

               np.array([a for a in set(A)], dtype=np.int32))

    print(ans)

from numba import njit, int32
import numpy as np


@njit(int32(int32[:], int32[:]))
def main(A, B):
    ans = 0
    for a in A:
        B[a] += 1
    for a in set(A):
        v = 2 * a
        while v <= 10**6:
            B[v] += 1
            v += a
    for a in A:
        if B[a] == 1:
            ans += 1
    return ans


if __name__ == "__main__":
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    B = [0] * (10**6 + 1)
    ans = main(np.array(A, dtype=np.int32), np.array(B, dtype=np.int32))
    print(ans)

from numba import njit, int32
import numpy as np


@njit(int32(int32[:], int32[:], int32[:]))
def main(A, B, C):
    ans = 0
    for a in A:
        B[a] += 1
    for a in C:
        v = 2 * a
        while v <= 10**6:
            B[v] += 1
            v += a
    for a in A:
        if B[a] == 1:
            ans += 1
    return ans


if __name__ == "__main__":
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    B = [0] * (10**6 + 1)
    ans = main(
        np.array(A, dtype=np.int32),
        np.array(B, dtype=np.int32),
        np.array([a for a in set(A)], dtype=np.int32),
    )
    print(ans)

-@njit(int32(int32[:], int32[:])) -def main(A, B): +@njit(int32(int32[:], int32[:], int32[:])) +def main(A, B, C): -    for a in set(A): +    for a in C: -    ans = main(np.array(A, dtype=np.int32), np.array(B, dtype=np.int32)) +    ans = main( +        np.array(A, dtype=np.int32), +        np.array(B, dtype=np.int32), +        np.array([a for a in set(A)], dtype=np.int32), +    )