#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int n,sum,ans;
int main()
{
scanf("%d%d", &n, &sum);
while(n--)
{
int a;
cin>>a;
sum-=a;
if(sum>=0) ans++;
}
cout<<ans;
return 0;
}