import 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[] bound = new int[n];
        int[] d = new int[n+1];
      
        int count = 0;
      
        for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        }
      
        d[0]= 0;
      
        for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        }
      
       for(int num:d){
         if(num <= x){
           count++;
         }
       }
       System.out.println(count);        
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
      
		Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int x = sc.nextInt();
      
        int[] bound = new int[n];
        int[] d = new int[n+1];
      
        int count = 0;
      
        for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        }
      
        d[0]= 0;
      
        for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        }
      
       for(int num:d){
         if(num <= x){
           count++;
         }
       }
       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[] bound = new int[n];
        int[] d = new int[n+1];
      
        int count = 0;
      
        for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        }
      
        d[0]= 0;
      
        for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        }
      
       for(int num:d){
         if(num <= x){
           count++;
         }
       }
       System.out.println(count);        
	} main {
      
		Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        int x = sc.nextInt();
      
        int[] bound = new int[n];
        int[] d = new int[n+1];
      
        int count = 0;
      
        for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        }
      
        d[0]= 0;
      
        for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        }
      
       for(int num:d){
         if(num <= x){
           count++;
         }
       }
       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[] bound = new int[n]; bound new int[n] n int[] d = new int[n+1]; d new int[n+1] n+1 n 1 int count = 0; count 0 for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        } int cr=0; int cr=0; cr 0 cr<n cr n cr++ cr++ cr {
            bound[cr] = sc.nextInt();
        } {
            bound[cr] = sc.nextInt();
        } bound[cr] = sc.nextInt() bound[cr] bound cr sc.nextInt() sc.nextInt sc d[0]= 0 d[0] d 0 0 for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        } int cr=1; int cr=1; cr 1 cr<n+1 cr n+1 n 1 cr++ cr++ cr {
            d[cr] = d[cr-1] + bound[cr-1];
        } {
            d[cr] = d[cr-1] + bound[cr-1];
        } d[cr] = d[cr-1] + bound[cr-1] d[cr] d cr d[cr-1] + bound[cr-1] d[cr-1] d cr-1 cr 1 bound[cr-1] bound cr-1 cr 1 for(int num:d){
         if(num <= x){
           count++;
         }
       } int num d {
         if(num <= x){
           count++;
         }
       } {
         if(num <= x){
           count++;
         }
       } if(num <= x){
           count++;
         } num <= x num x {
           count++;
         } count++ count 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[] bound = new int[n];
        int[] d = new int[n+1];
      
        int count = 0;
      
        for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        }
      
        d[0]= 0;
      
        for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        }
      
       for(int num:d){
         if(num <= x){
           count++;
         }
       }
       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[] bound = new int[n];
        int[] d = new int[n+1];
      
        int count = 0;
      
        for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        }
      
        d[0]= 0;
      
        for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        }
      
       for(int num:d){
         if(num <= x){
           count++;
         }
       }
       System.out.println(count);        
	}
} Main
import 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[] bound = new int[n];
        int[] d = new int[n+1];
      
        int count = 0;
      
        for(int cr=0; cr<n; cr++){
            bound[cr] = sc.nextInt();
        }
      
        d[0]= 0;
      
        for(int cr=1; cr<n+1; cr++){
            d[cr] = d[cr-1] + bound[cr-1];
        }
      
       for(int num:d){
         if(num <= x){
           count++;
         }
       }
       System.out.println(count);        
	}
}
