import java.util.Scanner

import scala.collection.mutable

object Main {

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val a = Vector.fill(n)(sc.nextInt())

    val m = 1000005

    val cnt = mutable.ArrayBuffer.fill(m)(0)

    a.foreach { x =>
      if (cnt(x) != 0) {
        cnt(x) = 2
      } else {
        (x to(m, x)).foreach { i => cnt(i) += 1 }
      }
    }
    println(a.count(cnt(_) == 1))
  }
}
