import Data.List

naive_solver::[Int]->Int
naive_solver ls = let grpd = group (sort ls) in
                  foldl (\ count -> \ el -> count + (if (head el)>(length el)then (length el) else (length el)-(head el)) ) 0 grpd

main::IO()
main=do
  _<-getLine
  datc<-getLine
  let dat = map read (words datc)
  print (naive_solver dat)