'use strict';

function main(stdin) {
  const input = stdin.split('\n');
  const temp = input.shift().split(' ').map(v => parseInt(v, 10));
  const N = temp[0];
  const X = temp[1];
  const L = input[0].split(' ').map(v => parseInt(v, 10));

  let d = 0;
  const bound = [0];

  L.forEach(l => {
    d += l;
    bound.push(d);
  });
  
  console.log(bound.filter(b => b <= X).length);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));