import java.util.*;

class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	int x = sc.nextInt();
      	List<Integer> list = new ArrayList<>();
      
      	int count = 1, d = 0;
      	for(int i = 0; i < n; i++){
        	list.add(sc.nextInt());
        } 
      	
      	int temp;
      	for(int i = 1; i <= n; i++){
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= x){
            	count++;
            }else{
            	break;
            }
        }
      
      	System.out.println(count);
    }
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	int x = sc.nextInt();
      	List<Integer> list = new ArrayList<>();
      
      	int count = 1, d = 0;
      	for(int i = 0; i < n; i++){
        	list.add(sc.nextInt());
        } 
      	
      	int temp;
      	for(int i = 1; i <= n; i++){
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= 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();
      	List<Integer> list = new ArrayList<>();
      
      	int count = 1, d = 0;
      	for(int i = 0; i < n; i++){
        	list.add(sc.nextInt());
        } 
      	
      	int temp;
      	for(int i = 1; i <= n; i++){
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= x){
            	count++;
            }else{
            	break;
            }
        }
      
      	System.out.println(count);
    } main {
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	int x = sc.nextInt();
      	List<Integer> list = new ArrayList<>();
      
      	int count = 1, d = 0;
      	for(int i = 0; i < n; i++){
        	list.add(sc.nextInt());
        } 
      	
      	int temp;
      	for(int i = 1; i <= n; i++){
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= 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 List<Integer> list = new ArrayList<>(); list new ArrayList<>() int count = 1 count 1 d = 0; d 0 for(int i = 0; i < n; i++){
        	list.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        	list.add(sc.nextInt());
        } {
        	list.add(sc.nextInt());
        } list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc int temp; temp for(int i = 1; i <= n; i++){
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= x){
            	count++;
            }else{
            	break;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= x){
            	count++;
            }else{
            	break;
            }
        } {
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= x){
            	count++;
            }else{
            	break;
            }
        } temp = d temp d d = temp + list.get(i-1) d temp + list.get(i-1) temp list.get(i-1) list.get list i-1 i 1 if(d <= x){
            	count++;
            }else{
            	break;
            } d <= x d x {
            	count++;
            } count++ count {
            	break;
            } break; System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;

class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	int x = sc.nextInt();
      	List<Integer> list = new ArrayList<>();
      
      	int count = 1, d = 0;
      	for(int i = 0; i < n; i++){
        	list.add(sc.nextInt());
        } 
      	
      	int temp;
      	for(int i = 1; i <= n; i++){
           	temp = d;
        	d = temp + list.get(i-1);
          	if(d <= x){
            	count++;
            }else{
            	break;
            }
        }
      
      	System.out.println(count);
    }
}