
fun main() {
    val n = readLine()!!.trim().toInt()
    val nums = readLine()!!.trim().split(' ').map(String::toInt)
    val group = nums.groupBy { it }
    val isDividable = BooleanArray(1000001){false}
    for ((a, l) in group) {
        if (l.size > 1) isDividable[a] = true
        for (i in (a shl 1) until isDividable.size step a) {
            isDividable[i] = true
        }
    }
    println(nums.count { !isDividable[it] })
}