import scala.io.StdIn._

object Main extends App {
  private val MAX = 1_000_000

  val n = readInt
  val A = readLine.split(" ").map(_.toInt)
  val v = Array.fill(MAX + 10)(0)

  A.foreach { Ai =>
    if (v(Ai) > 0) {
      v(Ai) = 2
    } else {
      for (step <- Ai to MAX by Ai) {
        v(step) += 1
      }
    }
  }

  val ans = A.count { Ai => v(Ai) == 1 }
  println(ans)
}

