import Data.List (sort)

func :: Int -> [Int] -> Int -> Int
func c [] r
  | r > 0 = c - 1
  | otherwise = c
func c (x:xs) r
  | r >= x = func (c+1) xs (r-x)
  | otherwise = c

main = do
  line1 <- getLine
  line2 <- getLine
  let
    [_,x] = map read $ words line1 :: [Int]
    dat = sort $ map read $ words line2 :: [Int]
    ans = func 0 dat x
  putStrLn $ show ans
