object Main extends App {
  var Array(n,x) = readLine.split(" ").map(_.toInt)
  var z = 0
  var i = 0
  readLine.split(" ").foreach{s=>
    if(z<=x){
      i += 1
      z += s.toInt
    }      
  }
  if(z<=x) i += 1
  println(i)
}