import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    as <- getIntList
    print . (\m -> n - ((m+1) * m `div` 2) ) . length . takeWhile (>= 0) . zipWith (flip (-)) [1..n] . map (pred . length) . group . sort $ as ++ [1..n]