import           Data.List
main = do
    n <- readLn :: IO Int
    d <- map read . words <$> getLine :: IO [Int]
    print $ length . filter (==True) . map f $ map (\k -> span (<k) (sort d)) [0..maximum d]
  where
    f (a,b) = length a == length b
