fun main() {
    val n = readLine()!!.toInt()
    val list = readLine()!!.split(" ").map { it.toInt() }
    val group = list
        .asSequence()
        .groupBy { it }
        .map { (key, value) -> key to (value.size > 1) }

    val isDividable = BooleanArray(list.max()!! + 1) { true }
    for ((num, value) in group) {
        if (value) isDividable[num] = false

        for (i in (num * 2) until isDividable.size step num) {
            isDividable[i] = false
        }
    }
    println(list.count { isDividable[it] })
}