import scala.collection.mutable.ListBuffer
import scala.io.StdIn

object Main extends App {

  val n = StdIn.readLine().trim.toInt
  val lst: Array[Int] = (0 until n).map{ _ =>
    StdIn.readLine().trim.toInt
  }.sorted.toArray
  
  var lsize = lst.size

  var evl = 2
  var max = lst.last
  while(evl < scala.math.sqrt(max)){
    (0 until lsize).foreach{ i =>
      val tmp = lst(i)
      if(tmp != evl){
        lst(i) = if(tmp % evl == 0) 0 else tmp
      }
    }
    evl += 1
  }

  println(lst.filter(p => p != 0).size)
  
}

