object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N = in.nextInt
  val As = List.fill(N)(in.nextInt).sorted
  val dividable = new Array[Boolean](1_000_001)

  def count(l: List[Int], c: Int): Int = l match {
    case Nil => c
    case x :: xs =>
      if (dividable(x)) count(xs, c)
      else {
        (x to 1_000_000 by x).foreach {i => dividable(i) = true}
        count(xs, c + (if (xs.headOption == Some(x)) 0 else 1))
      }
  }

  println(count(As, 0))
}
