import sys

import numpy as np

from numba import njit



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



U = 10**6 + 10



@njit('(i8[::1],i8[::1])', cache=True)

def solve(A, primes):

    B = np.zeros(U + 1, np.int64)

    for x in A:

        B[x] += 1

    for p in primes:

        for i in range(U // p + 1):

            B[p * i] += B[i]

    ret = 0

    for x in A:

        ret += B[x] == 1

    return ret



def prime_table(N):

    is_prime = np.zeros(N, np.int64)

    is_prime[2:3] = 1

    is_prime[3::2] = 1

    for p in range(3, N, 2):

        if p * p >= N:

            break

        if is_prime[p]:

            is_prime[p * p::p + p] = 0

    return is_prime, np.where(is_prime)[0]



A = np.array(read().split(), np.int64)[1:]

_, primes = prime_table(U)



print((solve(A, primes)))
import sys

import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



U = 10**6 + 10



def main(A, primes):

    B = np.zeros(U + 1, np.int64)

    for x in A:

        B[x] += 1

    for p in primes:

        for i in range(U // p + 1):

            B[p * i] += B[i]

    ret = 0

    for x in A:

        ret += B[x] == 1

    return ret



if sys.argv[-1] == 'ONLINE_JUDGE':

    from numba.pycc import CC

    cc = CC('my_module')

    cc.export('main', '(i8[::1],i8[::1])')(main)

    cc.compile()

    exit()

from my_module import main



def prime_table(N):

    is_prime = np.zeros(N, np.int64)

    is_prime[2:3] = 1

    is_prime[3::2] = 1

    for p in range(3, N, 2):

        if p * p >= N:

            break

        if is_prime[p]:

            is_prime[p * p::p + p] = 0

    return is_prime, np.where(is_prime)[0]



A = np.array(read().split(), np.int64)[1:]

_, primes = prime_table(U)



print((main(A, primes)))

import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
U = 10**6 + 10


@njit("(i8[::1],i8[::1])", cache=True)
def solve(A, primes):
    B = np.zeros(U + 1, np.int64)
    for x in A:
        B[x] += 1
    for p in primes:
        for i in range(U // p + 1):
            B[p * i] += B[i]
    ret = 0
    for x in A:
        ret += B[x] == 1
    return ret


def prime_table(N):
    is_prime = np.zeros(N, np.int64)
    is_prime[2:3] = 1
    is_prime[3::2] = 1
    for p in range(3, N, 2):
        if p * p >= N:
            break
        if is_prime[p]:
            is_prime[p * p :: p + p] = 0
    return is_prime, np.where(is_prime)[0]


A = np.array(read().split(), np.int64)[1:]
_, primes = prime_table(U)
print((solve(A, primes)))

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
U = 10**6 + 10


def main(A, primes):
    B = np.zeros(U + 1, np.int64)
    for x in A:
        B[x] += 1
    for p in primes:
        for i in range(U // p + 1):
            B[p * i] += B[i]
    ret = 0
    for x in A:
        ret += B[x] == 1
    return ret


if sys.argv[-1] == "ONLINE_JUDGE":
    from numba.pycc import CC

    cc = CC("my_module")
    cc.export("main", "(i8[::1],i8[::1])")(main)
    cc.compile()
    exit()
from my_module import main


def prime_table(N):
    is_prime = np.zeros(N, np.int64)
    is_prime[2:3] = 1
    is_prime[3::2] = 1
    for p in range(3, N, 2):
        if p * p >= N:
            break
        if is_prime[p]:
            is_prime[p * p :: p + p] = 0
    return is_prime, np.where(is_prime)[0]


A = np.array(read().split(), np.int64)[1:]
_, primes = prime_table(U)
print((main(A, primes)))

-from numba import njit -@njit("(i8[::1],i8[::1])", cache=True) -def solve(A, primes): +def main(A, primes): + + +if sys.argv[-1] == "ONLINE_JUDGE": +    from numba.pycc import CC + +    cc = CC("my_module") +    cc.export("main", "(i8[::1],i8[::1])")(main) +    cc.compile() +    exit() +from my_module import main -print((solve(A, primes))) +print((main(A, primes)))