import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int anss = 0;
		int j=1;
		int N = sc.nextInt();
		int X = sc.nextInt();
		//整数型配列の宣言と初期化
		int [] arys;
		arys = new int [N+1];
		
		for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		}
		for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		}
		
		if(j>N)
		{anss=N+1;
		}
		if(sum>X)
		{anss=j-1;
		}
		if(sum==X)
		{anss=j;
		}
		System.out.println(anss);
		}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int anss = 0;
		int j=1;
		int N = sc.nextInt();
		int X = sc.nextInt();
		//整数型配列の宣言と初期化
		int [] arys;
		arys = new int [N+1];
		
		for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		}
		for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		}
		
		if(j>N)
		{anss=N+1;
		}
		if(sum>X)
		{anss=j-1;
		}
		if(sum==X)
		{anss=j;
		}
		System.out.println(anss);
		}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int anss = 0;
		int j=1;
		int N = sc.nextInt();
		int X = sc.nextInt();
		//整数型配列の宣言と初期化
		int [] arys;
		arys = new int [N+1];
		
		for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		}
		for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		}
		
		if(j>N)
		{anss=N+1;
		}
		if(sum>X)
		{anss=j-1;
		}
		if(sum==X)
		{anss=j;
		}
		System.out.println(anss);
		} main {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int anss = 0;
		int j=1;
		int N = sc.nextInt();
		int X = sc.nextInt();
		//整数型配列の宣言と初期化
		int [] arys;
		arys = new int [N+1];
		
		for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		}
		for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		}
		
		if(j>N)
		{anss=N+1;
		}
		if(sum>X)
		{anss=j-1;
		}
		if(sum==X)
		{anss=j;
		}
		System.out.println(anss);
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int sum = 0; sum 0 int anss = 0; anss 0 int j=1; j 1 int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int [] arys; arys arys = new int [N+1] arys new int [N+1] N+1 N 1 for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {		
		arys[i-1]=sc.nextInt();
		} {		
		arys[i-1]=sc.nextInt();
		} arys[i-1]=sc.nextInt() arys[i-1] arys i-1 i 1 sc.nextInt() sc.nextInt sc for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		} j=1; j=1 j 1 sum<X&&j<=N sum<X sum X j<=N j N j++ j++ j {
			sum=sum+arys[j-1];
		} {
			sum=sum+arys[j-1];
		} sum=sum+arys[j-1] sum sum+arys[j-1] sum arys[j-1] arys j-1 j 1 if(j>N)
		{anss=N+1;
		} j>N j N {anss=N+1;
		} anss=N+1 anss N+1 N 1 if(sum>X)
		{anss=j-1;
		} sum>X sum X {anss=j-1;
		} anss=j-1 anss j-1 j 1 if(sum==X)
		{anss=j;
		} sum==X sum X {anss=j;
		} anss=j anss j System.out.println(anss) System.out.println System.out System System.out anss String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int anss = 0;
		int j=1;
		int N = sc.nextInt();
		int X = sc.nextInt();
		//整数型配列の宣言と初期化
		int [] arys;
		arys = new int [N+1];
		
		for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		}
		for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		}
		
		if(j>N)
		{anss=N+1;
		}
		if(sum>X)
		{anss=j-1;
		}
		if(sum==X)
		{anss=j;
		}
		System.out.println(anss);
		}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int anss = 0;
		int j=1;
		int N = sc.nextInt();
		int X = sc.nextInt();
		//整数型配列の宣言と初期化
		int [] arys;
		arys = new int [N+1];
		
		for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		}
		for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		}
		
		if(j>N)
		{anss=N+1;
		}
		if(sum>X)
		{anss=j-1;
		}
		if(sum==X)
		{anss=j;
		}
		System.out.println(anss);
		}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		int anss = 0;
		int j=1;
		int N = sc.nextInt();
		int X = sc.nextInt();
		//整数型配列の宣言と初期化
		int [] arys;
		arys = new int [N+1];
		
		for(int i=1; i<=N;i++)
		{		
		arys[i-1]=sc.nextInt();
		}
		for(j=1;sum<X&&j<=N;j++){
			sum=sum+arys[j-1];
		}
		
		if(j>N)
		{anss=N+1;
		}
		if(sum>X)
		{anss=j-1;
		}
		if(sum==X)
		{anss=j;
		}
		System.out.println(anss);
		}
}
