import numpy as np

# import math

# import copy

# from collections import deque

import sys

input = sys.stdin.readline

# sys.setrecursionlimit(10000)

# from numba import njit,i8





def sieve(N,A,dp):

    for i in range(N):

        now = A[i]

        M = A[-1] // now

        for j in range(2,M+1):

            dp[now*j-1] = False

    return dp





def cnt(N,A,dp):

    skip = 0

    res = 0

    for i in range(N):

        now = A[i]

        if skip == now:

            continue

        if i != N - 1:

            if now == A[i+1]:

                skip = now

                continue

        if dp[now-1]:

            res += 1

    return res





def main():

    N = int(eval(input()))

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



    A = sorted(A)

    A = np.array(A)



    dp = np.array([True for i in range(A[-1])])

    # print(dp)

    dp = sieve(N,A,dp)

    # print(dp)



    res = cnt(N,A,dp)



    print(res)







main()

import numpy as np

# import math

# import copy

# from collections import deque

import sys

input = sys.stdin.readline

# sys.setrecursionlimit(10000)

from numba import njit,i8,b1





# @njit(b1[:](i8,i8,b1[:]))

@njit

def sieve(N,A,dp):

    for i in range(N):

        now = A[i]

        M = A[-1] // now

        for j in range(2,M+1):

            dp[now*j-1] = False

    return dp





# @njit(i8(i8,i8,b1[:]))

@njit

def cnt(N,A,dp):

    skip = 0

    res = 0

    for i in range(N):

        now = A[i]

        if skip == now:

            continue

        if i != N - 1:

            if now == A[i+1]:

                skip = now

                continue

        if dp[now-1]:

            res += 1

    return res





def main():

    N = int(eval(input()))

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



    A = sorted(A)

    A = np.array(A)



    dp = np.array([True for i in range(A[-1])])

    # print(dp)

    dp = sieve(N,A,dp)

    # print(dp)



    res = cnt(N,A,dp)



    print(res)







main()

import numpy as np

# import math
# import copy
# from collections import deque
import sys

input = sys.stdin.readline
# sys.setrecursionlimit(10000)
# from numba import njit,i8
def sieve(N, A, dp):
    for i in range(N):
        now = A[i]
        M = A[-1] // now
        for j in range(2, M + 1):
            dp[now * j - 1] = False
    return dp


def cnt(N, A, dp):
    skip = 0
    res = 0
    for i in range(N):
        now = A[i]
        if skip == now:
            continue
        if i != N - 1:
            if now == A[i + 1]:
                skip = now
                continue
        if dp[now - 1]:
            res += 1
    return res


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A = sorted(A)
    A = np.array(A)
    dp = np.array([True for i in range(A[-1])])
    # print(dp)
    dp = sieve(N, A, dp)
    # print(dp)
    res = cnt(N, A, dp)
    print(res)


main()

import numpy as np

# import math
# import copy
# from collections import deque
import sys

input = sys.stdin.readline
# sys.setrecursionlimit(10000)
from numba import njit, i8, b1

# @njit(b1[:](i8,i8,b1[:]))
@njit
def sieve(N, A, dp):
    for i in range(N):
        now = A[i]
        M = A[-1] // now
        for j in range(2, M + 1):
            dp[now * j - 1] = False
    return dp


# @njit(i8(i8,i8,b1[:]))
@njit
def cnt(N, A, dp):
    skip = 0
    res = 0
    for i in range(N):
        now = A[i]
        if skip == now:
            continue
        if i != N - 1:
            if now == A[i + 1]:
                skip = now
                continue
        if dp[now - 1]:
            res += 1
    return res


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A = sorted(A)
    A = np.array(A)
    dp = np.array([True for i in range(A[-1])])
    # print(dp)
    dp = sieve(N, A, dp)
    # print(dp)
    res = cnt(N, A, dp)
    print(res)


main()

-# from numba import njit,i8 +from numba import njit, i8, b1 + +# @njit(b1[:](i8,i8,b1[:])) +@njit +# @njit(i8(i8,i8,b1[:])) +@njit