
import java.util.Scanner;

public class Main{
	
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int[] array=new int[N];
		for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		}
		
		int count=1;
		int[] D=new int[N+1];
		D[0]=0;
		
		for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		}
		
		System.out.println(count);
		
	}

} import java.util.Scanner; Scanner java.util public class Main{
	
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int[] array=new int[N];
		for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		}
		
		int count=1;
		int[] D=new int[N+1];
		D[0]=0;
		
		for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		}
		
		System.out.println(count);
		
	}

} Main public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int[] array=new int[N];
		for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		}
		
		int count=1;
		int[] D=new int[N+1];
		D[0]=0;
		
		for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		}
		
		System.out.println(count);
		
	} main {
		Scanner sc= new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int[] array=new int[N];
		for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		}
		
		int count=1;
		int[] D=new int[N+1];
		D[0]=0;
		
		for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		}
		
		System.out.println(count);
		
	} Scanner sc= new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int[] array=new int[N]; array new int[N] N for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			array[i]=sc.nextInt();
		} {
			array[i]=sc.nextInt();
		} array[i]=sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc int count=1; count 1 int[] D=new int[N+1]; D new int[N+1] N+1 N 1 D[0]=0 D[0] D 0 0 for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		} int j=1; int j=1; j 1 j<=N j N j++ j++ j {
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		} {
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		} D[j]=D[j-1]+array[j-1] D[j] D j D[j-1]+array[j-1] D[j-1] D j-1 j 1 array[j-1] array j-1 j 1 if(D[j]<=X)count++;
			else break; D[j]<=X D[j] D j X count++ count break; System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
	
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int[] array=new int[N];
		for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		}
		
		int count=1;
		int[] D=new int[N+1];
		D[0]=0;
		
		for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		}
		
		System.out.println(count);
		
	}

} public class Main{
	
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int[] array=new int[N];
		for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		}
		
		int count=1;
		int[] D=new int[N+1];
		D[0]=0;
		
		for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		}
		
		System.out.println(count);
		
	}

} Main

import java.util.Scanner;

public class Main{
	
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		
		int[] array=new int[N];
		for(int i=0;i<N;i++){
			array[i]=sc.nextInt();
		}
		
		int count=1;
		int[] D=new int[N+1];
		D[0]=0;
		
		for(int j=1;j<=N;j++){
			D[j]=D[j-1]+array[j-1];
			if(D[j]<=X)count++;
			else break;
		}
		
		System.out.println(count);
		
	}

}
