import Data.List

main :: IO ()
main = do
  n <- readLn :: IO Int
  as <- map read . words <$> getLine :: IO [Int]
  print $ solve as
  return ()

solve :: [Int] -> Int
solve xs = sum $
           map f $
           group $ sort xs
  where
    f [] = 0
    f ys@(y:_)
      | y == n = 0
      | n > y = n-y
      | n < y = n
        where
          n = length ys
