import java.util.*;

class Main {
	  static int mod=1_000_000_007;
  public static void main(String[] args) {
	  Scanner sc = new Scanner(System.in);
      long cnt =0;
      long cnt2 =0;
      int flg=0;
      long N = sc.nextLong();
      long X = sc.nextLong();
      
      long[] a = new long[(int)N];
      for (int i=0 ; i<N; i++) {
          a[i] = sc.nextLong();
      }

      for(int i=0;i<N;i++) {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      }
      if(cnt<=X) {
    	  cnt2++;
      }
	  System.out.println(cnt2);
  }
  
 
} import java.util.*; util.* java class Main {
	  static int mod=1_000_000_007;
  public static void main(String[] args) {
	  Scanner sc = new Scanner(System.in);
      long cnt =0;
      long cnt2 =0;
      int flg=0;
      long N = sc.nextLong();
      long X = sc.nextLong();
      
      long[] a = new long[(int)N];
      for (int i=0 ; i<N; i++) {
          a[i] = sc.nextLong();
      }

      for(int i=0;i<N;i++) {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      }
      if(cnt<=X) {
    	  cnt2++;
      }
	  System.out.println(cnt2);
  }
  
 
} Main static int mod=1_000_000_007; mod 1_000_000_007 public static void main(String[] args) {
	  Scanner sc = new Scanner(System.in);
      long cnt =0;
      long cnt2 =0;
      int flg=0;
      long N = sc.nextLong();
      long X = sc.nextLong();
      
      long[] a = new long[(int)N];
      for (int i=0 ; i<N; i++) {
          a[i] = sc.nextLong();
      }

      for(int i=0;i<N;i++) {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      }
      if(cnt<=X) {
    	  cnt2++;
      }
	  System.out.println(cnt2);
  } main {
	  Scanner sc = new Scanner(System.in);
      long cnt =0;
      long cnt2 =0;
      int flg=0;
      long N = sc.nextLong();
      long X = sc.nextLong();
      
      long[] a = new long[(int)N];
      for (int i=0 ; i<N; i++) {
          a[i] = sc.nextLong();
      }

      for(int i=0;i<N;i++) {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      }
      if(cnt<=X) {
    	  cnt2++;
      }
	  System.out.println(cnt2);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long cnt =0; cnt 0 long cnt2 =0; cnt2 0 int flg=0; flg 0 long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long X = sc.nextLong(); X sc.nextLong() sc.nextLong sc long[] a = new long[(int)N]; a new long[(int)N] (int)N for (int i=0 ; i<N; i++) {
          a[i] = sc.nextLong();
      } int i=0 ; int i=0 ; i 0 i<N i N i++ i++ i {
          a[i] = sc.nextLong();
      } {
          a[i] = sc.nextLong();
      } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc for(int i=0;i<N;i++) {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      } {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      } if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  } cnt<=X cnt X {
    		  cnt2++;
    	  } cnt2++ cnt2 {
    		  break;
    	  } break; cnt=cnt+a[i] cnt cnt+a[i] cnt a[i] a i if(cnt<=X) {
    	  cnt2++;
      } cnt<=X cnt X {
    	  cnt2++;
      } cnt2++ cnt2 System.out.println(cnt2) System.out.println System.out System System.out cnt2 String[] args args
import java.util.*;

class Main {
	  static int mod=1_000_000_007;
  public static void main(String[] args) {
	  Scanner sc = new Scanner(System.in);
      long cnt =0;
      long cnt2 =0;
      int flg=0;
      long N = sc.nextLong();
      long X = sc.nextLong();
      
      long[] a = new long[(int)N];
      for (int i=0 ; i<N; i++) {
          a[i] = sc.nextLong();
      }

      for(int i=0;i<N;i++) {
    	  if (cnt<=X) {
    		  cnt2++;
    	  } else {
    		  break;
    	  }
    	  cnt=cnt+a[i];
      }
      if(cnt<=X) {
    	  cnt2++;
      }
	  System.out.println(cnt2);
  }
  
 
}