module Main where import Data.List solve :: [Int] -> Int -> Int solve [] _ = 0 solve (x:xs) y | y < x = 0 | otherwise = 1 + solve xs (y - x) main :: IO () main = do l <- fmap read getLine _ <- getLine ws <- fmap (map read . words) getLine print $ solve (sort ws) l