
fun main() {
    // 5
    // 3 8 11 16 24
    val n = nextInt()
    val values = nextIntList().sorted()
    val MAX = values.last()
    val elats = Array(MAX + 1) { true }
    var res = 0
    values.forEachIndexed { index, i ->
        val result = elats[i]
        (i..MAX step i).forEach {
            elats[it] = false
        }
        if ((index > 0 && i == values[index - 1]) || (index < n - 1 && i == values[index + 1])) {
            return@forEachIndexed
        }
        if (result) {
            res++
        }
    }
    println(res)
}

// # Utils
// ## Input
fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = next().split(" ").map(String::toInt)
fun nextLongList() = next().split(" ").map(String::toLong)
fun nextDoubleList() = next().split(" ").map(String::toDouble)
