#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <iterator>
#include <cmath>

using namespace std;

template<class V0,class V1=void*,class V2=void*,class V3=void*>struct T{V0 t0; V1 t1; V2 t2; V3 t3;};
template<class V0,class V1,class V2,class V3>bool operator==(T<V0,V1,V2,V3>const&t,T<V0,V1,V2,V3>const&u){return t.t0==u.t0&&t.t1==u.t1&&t.t2==u.t2&&t.t3&&u.t3;}
template<class V0,class V1,class V2,class V3>bool operator<(T<V0,V1,V2,V3>const&t,T<V0,V1,V2,V3>const&u){
  return (t.t0<u.t0)||(t.t0==u.t0 && t.t1<u.t1)||(t.t0==u.t0&&t.t1==u.t1&&t.t2<u.t2)||(t.t0==u.t0&&t.t1==u.t1&&t.t2==u.t2&&t.t3<u.t3);
}
namespace std{
template<class V0, class V1, class V2, class V3> 
struct hash<T<V0,V1,V2,V3>>{size_t operator()(T<V0,V1,V2,V3>const&t)const noexcept{return((hash<V0>{}(t.t0)*31+hash<V1>{}(t.t1))*31+hash<V2>{}(t.t2))*31+hash<V3>{}(t.t3);}};
}

template<class A0>void input(A0 &a0) { cin>>a0; }
template<class A0, class A1>void input(A0 &a0, A1 &a1) { cin>>a0>>a1; }
template<class A0, class A1, class A2>void input(A0 &a0, A1 &a1, A2 &a2) { cin>>a0>>a1>>a2; }
template<class A0, class A1, class A2, class A3>void input(A0 &a0, A1 &a1, A2 &a2, A3 &a3) { cin>>a0>>a1>>a2>>a3; }
template<class V>istream&operator>>(istream&is,vector<V>&a){for(auto&e:a)is>>e;return is;}

template<class A0>void print(A0 const &a0) {cout<<a0<<endl;}
template<class A0, class A1>void print(A0 const&a0,A1 const&a1) {cout<<a0<<" ";print(a1);}
template<class A0, class A1, class A2>void print(A0 const &a0, A1 const&a1, A2 const&a2) {cout<<a0<<" ";print(a1,a2);}
template<class A0,class A1,class A2,class A3>void print(A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3){cout<<a0<<" ";print(a1,a2,a3);}
template<class F,class S>ostream&operator<<(ostream&os,pair<F,S>const&pair){return os<<"("<<pair.first<<":"<<pair.second<<")";}

using lli = long long int;
lli gcd(lli const p, lli const q) { return q == 0 ? p : gcd(q, p%q); }
lli pow(lli const a, lli const n, lli const m){return(!n)?1:(n&1)?(((a%m)*pow(a,n-1,m))%m):[=](){lli b=pow(a,n/2,m);return(b*b)%m;}();}
lli inv(lli const a, lli const p) { return pow(a, p-2, p); }

template<class V0>ostream&operator<<(ostream&os,T<V0>const&t){return os<<"("<<t.t0<<")";}
template<class V0,class V1>ostream&operator<<(ostream&os,T<V0,V1>const&t){return os<<"("<<t.t0<<","<<t.t1<<")";}
template<class V0,class V1,class V2>ostream&operator<<(ostream&os,T<V0,V1,V2>const&t){return os<<"("<<t.t0<<","<<t.t1<<","<<t.t2<<")";}
template<class V0,class V1,class V2,class V3>ostream&operator<<(ostream&os,T<V0,V1,V2,V3>const&t){return os<<"("<<t.t0<<","<<t.t1<<","<<t.t2<<","<<t.t3<<")";}

template<class V>ostream&operator<<(ostream&os,list<V>const&a){os<<"[";for(auto i=a.begin(),e=a.end();i!=e;os<<((++i!=e)?",":"]"))os<<*i;return os;}
template<class V>ostream&operator<<(ostream&os,vector<V>const&a){os<<"[";for(auto i=a.begin(),e=a.end();i!=e;os<<((++i!=e)?",":"]"))os<<*i;return os;}
template<class V>ostream&operator<<(ostream&os,set<V>const&a){os<<"[";for(auto i=a.begin(),e=a.end();i!=e;os<<((++i!=e)?",":"]"))os<<*i;return os;}
template<class V>ostream&operator<<(ostream&os,unordered_set<V>const&a){os<<"[";for(auto i=a.begin(),e=a.end();i!=e;os<<((++i!=e)?",":"]"))os<<*i;return os;}
template<class K,class V>ostream&operator<<(ostream&os,map<K,V>const&a){os<<"[";for(auto i=a.begin(),e=a.end();i!=e;os<<((++i!=e)?",":"]"))os<<*i;return os;}
template<class K,class V>ostream&operator<<(ostream&os,unordered_map<K,V>const&a){os<<"[";for(auto i=a.begin(),e=a.end();i!=e;os<<((++i!=e)?",":"]"))os<<*i;return os;}


int main(){
  int N,X;
  input(N,X);
  vector<int> L(N);
  input(L);
  vector<int> D(N+1);
  D[0]=0;
  for(int i=0;i<L.size();++i) D[i+1]=D[i]+L[i];
  int cnt=0;
  for(int i=0;i<D.size();++i) {if(D[i]<=X)++cnt;}
  print(cnt);
}

Measured memory_bytes: 256