import java.util.*

fun main(args:Array<String>) {
    val N = 1000000
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val a = (0 until n).map { sc.next().toInt() }
    val ac = a.sorted().groupingBy { it }.eachCount()
    //println(ac)
    val erato : MutableList<Boolean> = MutableList(N+1) { false }
    var ans = 0
    ac.forEach {
        if (it.value == 1 && !erato[it.key]) ans += 1
        for (i in it.key..N step it.key) erato[i] = true
    }

    println(ans)

}