fun main() {
    readInt()
    val a = readInts().sorted()
    val seen = mutableSetOf<Int>()
    var ans = 0
    for ((index, i) in a.withIndex()) {
        if (i !in seen) {
            if (index == a.size - 1 || a[index + 1] != i) ans++
            seen.add(i)
            for (j in i..(1e6).toInt() step i) seen.add(j)
        }
    }

    println(ans)
}

// Input Reader
private fun readLn() = readLine()!!

private fun readStrings() = readLn().trim().split(" ")
private fun readInt() = readLn().toInt()
private fun readInts() = readStrings().map { it.toInt() }
