open Batteries

module IntSet = Set.Make(Int)

let count e xs =
  let rec go n = function
    | [] -> n
    | hd :: rest -> go (if hd = e then n + 1 else n) rest
  in go 0 xs

let solve xs =
  let set = IntSet.of_list xs |> IntSet.to_list in
  let n_reduce i =
    let ni = count i xs in
    if i < ni then ni - i
    else if i = ni then 0
    else ni in
  List.map n_reduce set |> List.sum |> print_int

let () =
  let _ = read_int () in
  let xs = read_line () |> String.split_on_char ' ' |> List.map int_of_string in
  solve xs