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)

  for (i <- 0 until n) {
    for (multiple <- a(i) to MAX by a(i)) {
      v(multiple) += 1
    }
  }

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

