main :: IO ()
main = do
  [n,x] <- map (read :: String -> Int) . words <$> getLine
  ln <- map (read :: String -> Int) . words <$> getLine
  print $ ans x ln

ans :: Int -> [Int] -> Int
ans x = fst . foldl (\(a,b) l -> if b+l <= x then (a+1,b+l) else (a,b)) (1,0)