'use strict'
const Main = (arg) => {
  let input = arg.trim().split('\n');
  let N = input[0].split(' ').map(Number)[0];
  let X = input[0].split(' ').map(Number)[1];
  let Arr = input[1].split(' ').map(Number);
  // console.log({ N, X, Arr });

  let D = [0];
  for (let i = 1; i <= N; i++) {
    D[i] = D[i - 1] + Arr[i - 1];
  }
  // console.log({ D });
  let Ans = 0;
  for (let i = 1; i <= N; i++) {
    if (D[i - 1] <= X) {
      Ans += 1;
    }
  }

  console.log(Ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
