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[]l = new int[n];

    int cou = 1;
    int d = 0;
    int a = 0;
    for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    }
    System.out.print(cou);
    }
} 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[]l = new int[n];

    int cou = 1;
    int d = 0;
    int a = 0;
    for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    }
    System.out.print(cou);
    }
} Main public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int[]l = new int[n];

    int cou = 1;
    int d = 0;
    int a = 0;
    for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    }
    System.out.print(cou);
    } main {
    
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int[]l = new int[n];

    int cou = 1;
    int d = 0;
    int a = 0;
    for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    }
    System.out.print(cou);
    } 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[]l = new int[n]; l new int[n] n int cou = 1; cou 1 int d = 0; d 0 int a = 0; a 0 for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    } {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    } l[i] = sc.nextInt() l[i] l i sc.nextInt() sc.nextInt sc if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	} d+l[i] <= x d+l[i] d l[i] l i x {
    		d += l[i];
    		cou++;
    	} d += l[i] d l[i] l i cou++ cou {
    		break;
    	} break; System.out.print(cou) System.out.print System.out System System.out cou 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[]l = new int[n];

    int cou = 1;
    int d = 0;
    int a = 0;
    for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    }
    System.out.print(cou);
    }
} public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int[]l = new int[n];

    int cou = 1;
    int d = 0;
    int a = 0;
    for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    }
    System.out.print(cou);
    }
} 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[]l = new int[n];

    int cou = 1;
    int d = 0;
    int a = 0;
    for(int i=0; i<n; i++) {
    	l[i] = sc.nextInt();
    	if(d+l[i] <= x ) {
    		d += l[i];
    		cou++;
    	}else {
    		break;
    	}
    }
    System.out.print(cou);
    }
}
