import std.stdio;
import std.algorithm;
import std.math;
import std.conv;
import std.string;

T readNum(T)(){
  return readStr.to!T;
}

T[] readNums(T)(){
  return readStr.split.to!(T[]);
}

string readStr(){
  return readln.chomp;
}

void main(){
  auto s = readNums!int;
  auto n = s[0], x = s[1];

  auto l = readNums!int;

  int ret;
  int d;

  if(d <= x) ret++;
  foreach(i; l){
    d += i;
    if(d <= x) ret++;
  }

  writeln(ret);
}
