import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

fun <A : Comparable<A>> min(a: A, b: A) = if (a < b) a else b
fun <A : Comparable<A>> max(a: A, b: A) = if (a > b) a else b

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val A = IntArray(N) { sc.next().toInt() }.sorted()
        val Amax = A.max()!!
        val div = BooleanArray(A.max()!! + 1)
        val ans = mutableSetOf<Int>()
        A.forEach { a ->
            if (!div[a]) {
                ans.add(a)
                for (i in a..Amax step a) div[i] = true
            } else if (ans.contains(a)) {
                ans.remove(a)
            }
        }
        pw.println(ans.count())
    }
}
