main = do
  [n,x] <- map read . words <$> getLine
  l <- map read . words <$> getLine
  print (f 1 0 x l)

f :: Int -> Int -> Int -> [Int] -> Int
f ans sum x l
  | l == [] = ans
  | sum + head l <= x = f (ans + 1) (sum + head l) x (tail l)
  | otherwise = ans
