Public Class Program
  Shared x As Integer
  Shared Sub Main()
    Dim nx As Integer() = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
    Dim n As Integer = nx(0)
    x = nx(1)
    Dim ls As Integer() = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
    Dim ds(0 To n) As Integer
    ds(0) = 0
    For i As Integer = 1 To n
      ds(i) = ds(i - 1) + ls(i - 1)
    Next
    Dim output As Integer = Array.FindAll(Of Integer)(ds, AddressOf IsLessThan).Length
    Console.WriteLine(output.ToString())
  End Sub
  
  Shared Function IsLessThan(value As Integer) As Boolean
    Return If(value <= x, True, False)
  End Function
End Class