solve :: Int -> [Int] -> [Int]
solve current [] = [current]
solve current (x:xs) = current:solve next xs
  where next = current + x

main :: IO ()
main = do
  [n, x] <- map read . words <$> getLine :: IO [Int]
  ls <- map read . words <$> getLine
  print . length $ filter (<=x) $ solve 0 ls
