type ABC(stream:System.IO.TextReader) =
  member this.Scan2 f1 f2 = stream.ReadLine().Split() |> (fun a -> (f1 a.[0], f2 a.[1]))
  member this.ScanVecH f = stream.ReadLine().Split() |> Array.map f

let util = ABC(stdin)

let N, X = util.Scan2 int int
let xs = util.ScanVecH int

xs
|> Seq.scan (+) 0
|> Seq.takeWhile (fun n -> n <= X)
|> Seq.length
|> printfn "%d"
