import Data.List

main :: IO()
main = do
    nx <- map read.words <$> getLine :: IO [Int]
{-
    lis <- scan (nx !! 0)
-}
    lis <- map read.words <$> getLine :: IO [Int]
    let list = sort lis
    print(solve (nx !! 1) list)

{-
scan :: Int -> IO [Int]
scan 0 = return []
scan n = do
    s <- getLine
    l <- scan$ n-1
    return$ s:l
-}

solve :: Int -> [Int] -> Int
solve _ [] = 0
solve x [a]
    | (x == a) = 1
    | otherwise = 0
solve x a
    | x < (a !! 0) = 0
    | otherwise = 1 + (solve (x - (a !! 0)) (tail a))