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