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[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) count++;
   System.out.println(count);
 }
} 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[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) 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[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) count++;
   System.out.println(count);
 } main {
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int X = sc.nextInt();
   int[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) 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[] Larr = new int[N]; Larr new int[N] N for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   } int i =1; int i =1; i 1 i<=N i N i++ i++ i {
    Larr[i-1] = sc.nextInt(); 
   } {
    Larr[i-1] = sc.nextInt(); 
   } Larr[i-1] = sc.nextInt() Larr[i-1] Larr i-1 i 1 sc.nextInt() sc.nextInt sc int sum = 0; sum 0 int count = 0; count 0 while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   } count < N && sum <= X count < N count N sum <= X sum X {
   sum = sum + Larr[count];
   count++;
   } sum = sum + Larr[count] sum sum + Larr[count] sum Larr[count] Larr count count++ count if(sum <=X && count ==N) count++; sum <=X && count ==N sum <=X sum X count ==N count N 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[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) 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[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) count++;
   System.out.println(count);
 }
} 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[] Larr = new int[N];
   for(int i =1;i<=N;i++){
    Larr[i-1] = sc.nextInt(); 
   }
int sum = 0;
int count = 0;
   while(count < N && sum <= X)
   {
   sum = sum + Larr[count];
   count++;
   }
   if(sum <=X && count ==N) count++;
   System.out.println(count);
 }
}