import Control.Monad import Control.Applicative import Data.List main::IO() main=do l <- readLn n <- readLn ::IO Int aa <- (map read . words) <$> getLine let sa=sort aa putStrLn $ show (solve sa l) solve :: [Int] -> Int -> Int solve [] y = 0 solve (x:xs) y | x<=y = 1+solve xs (y-x) |otherwise = 0