object Main extends App {
  val inputs: IndexedSeq[String] = scala.io.Source.stdin.getLines().toIndexedSeq

  val n = inputs(0).toInt
  val nums = inputs(1).split(" ").map(_.toInt)

  println(solve(n, nums))

  def solve(n: Int, nums: IndexedSeq[Int]): Int = {
    val sortedNums = nums.sorted
    val max = sortedNums(sortedNums.size - 1)
    var divSeq = sortedNums
    val results = scala.collection.mutable.IndexedSeq.fill(max + 1)(0)

    (1 to n).foreach { i =>
      // 分母
      val div = divSeq(i-1)

      if(results(div) <= 1) {
        Range.inclusive(div, max, div).foreach { j =>
          results.update(j, results(j) + 1)
        }

      }
    }
    var result = 0
    sortedNums.foreach { v =>
      if (results(v) == 1) {
        result = result + 1
      }
    }
    return result
  }
}