// Abx082 C
object Main extends App {
  val sc = new java.util.Scanner(System.in)

  val n = sc.nextInt
  val list = sc.nextLine.split(" ").map(_.toInt)

  val map = list.groupBy(identity).mapValues(_.length).toMap
  var delete_count = 0
  var checked = Map[Int, Boolean]()

  list.foreach({e =>
    if (checked.isDefinedAt(e)) {
    } else {
      if (map(e) > e) {
        delete_count += map(e) - e
      }

      if (map(e) < e) {
        delete_count += map(e)
      }

      checked += (e -> true)
    }
  })
  println(delete_count)
}
