fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    val a = readLine()!!.split(' ').map { it.toInt() }

    var m: MutableMap<Int, Int> = mutableMapOf()

    for (t in a) {
        m[t] = m.getOrDefault(t, 0) + 1
    }

    if (m.containsKey(1)) {
        if (m[1] == 1) {
            println(1)
        } else {
            println(0)
        }
        return
    }

    var ans = n

    for (t in a) {
        if (m[t]!! >= 2) {
            ans--
            continue
        }

        for (i in 2..t) {
            if (i * i > t)
                break

            if (t % i == 0) {
                if (m.containsKey(i) || m.containsKey(t / i)) {
                    ans--
                    break
                }
            }
        }
    }

    println(ans)

}