import Data.Bits
import Data.List
import Control.Monad
import Data.Array.Unboxed
import Data.Array.MArray
import Data.Array.ST
import Control.Monad.ST
import Data.Maybe (fromJust)
import qualified Data.ByteString.Lazy.Char8 as B
import Debug.Trace

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

  print $ length $ takeWhile ( <= x) $ scanl (+) 0 ls
