import qualified Data.List (sort) func :: Int -> [Int] -> Int func _ [] = 0 func size (x : xs) | x > size = 0 | otherwise = (+) 1 $ func (size - x) xs main :: IO () main = do l <- read <$> getLine :: IO Int _ <- getLine ws <- map read . words <$> getLine :: IO [Int] print $ func l $ Data.List.sort ws