import java.util.*;
import java.lang.Integer;

class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int X = sc.nextInt();
      
      int sumL = 0;
      int count = 0;
    
      while(X >= sumL){
        if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          break;
        }
      }
      System.out.println(count);
    }
} import java.util.*; util.* java import java.lang.Integer; Integer java.lang class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int X = sc.nextInt();
      
      int sumL = 0;
      int count = 0;
    
      while(X >= sumL){
        if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          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 sumL = 0;
      int count = 0;
    
      while(X >= sumL){
        if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          break;
        }
      }
      System.out.println(count);
    } main {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int X = sc.nextInt();
      
      int sumL = 0;
      int count = 0;
    
      while(X >= sumL){
        if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          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 sumL = 0; sumL 0 int count = 0; count 0 while(X >= sumL){
        if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          break;
        }
      } X >= sumL X sumL {
        if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          break;
        }
      } if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          break;
        } count < N count N {
          int L = sc.nextInt();
          sumL += L;
          count++;
        } int L = sc.nextInt(); L sc.nextInt() sc.nextInt sc sumL += L sumL L count++ count {
          count++;
          break;
        } count++ count break; System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;
import java.lang.Integer;

class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      int X = sc.nextInt();
      
      int sumL = 0;
      int count = 0;
    
      while(X >= sumL){
        if(count < N){
          int L = sc.nextInt();
          sumL += L;
          count++;
        }
        else{
          count++;
          break;
        }
      }
      System.out.println(count);
    }
}
