import Control.Monad
import Data.List

bitterAlchemy :: [Int] -> Int -> Int
bitterAlchemy ms x = makeDonut order 0
    where
        order = ms ++ (repeat . head $ ms)
        makeDonut (m:ms) result =
            if (result + m > x)
                then 0
                else 1 + makeDonut ms (result + m)

main :: IO ()
main = do
    [n,x] <- map read . words <$> getLine
    ms <- replicateM n (read <$> getLine)
    putStrLn . show $ bitterAlchemy (sort ms) x