fun main() {
  val n = readLine()!!.toInt()
  val a = readLine()!!.split(" ").map(String::toInt).toList().sorted()
  
  val boolArray = BooleanArray(a.max()!!)
  
  var a_before = 0
  for(a_i in a) {
    if(boolArray[a_i-1]) {
      a_before = a_i
      continue
    }
    
    if(a_i==a_before) {
      boolArray[a_i-1] = true
      a_before = a_i
      continue
    }
    
    for(j in 0 until (a.last()/a_i - 1)){
      boolArray[(a_i)*(j+2)-1] = true
    }
    
    a_before = a_i
  }
  
  var ans = 0
  for(a_i in a) if(!boolArray[a_i-1]) ans++
  println(ans)
}