fun main() = Thread(null, ::abc170d, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc170d() {
    readLine()!!
    val aList = readLine()!!.split(' ').map { it.toInt() }

    val max = aList.max()!!.toInt()
    val isValid = BooleanArray(max + 1)
    aList.forEach { isValid[it] = true }

    for (a in aList.distinct().sorted()) {
        if (!isValid[a]) continue
        var num = 2
        while (num <= max / a) isValid[(num++ * a)] = false
    }

    aList.groupBy { it }.filter { it.value.size >= 2 }
        .forEach { (t, _) -> isValid[t] = false }

    val answer = isValid.count { it }

    println(answer)
}
