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 ary[] = new int[n+1];
    ary[0] = 0;
    int d = 0;
    int cnt = 0;
    for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    }
    for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    }
    System.out.println(cnt);
  } 
} 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 ary[] = new int[n+1];
    ary[0] = 0;
    int d = 0;
    int cnt = 0;
    for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    }
    for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    }
    System.out.println(cnt);
  } 
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int ary[] = new int[n+1];
    ary[0] = 0;
    int d = 0;
    int cnt = 0;
    for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    }
    for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    }
    System.out.println(cnt);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int ary[] = new int[n+1];
    ary[0] = 0;
    int d = 0;
    int cnt = 0;
    for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    }
    for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    }
    System.out.println(cnt);
  } 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 ary[] = new int[n+1]; ary new int[n+1] n+1 n 1 ary[0] = 0 ary[0] ary 0 0 int d = 0; d 0 int cnt = 0; cnt 0 for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    } int c = 1; int c = 1; c 1 c<=n c n c++ c++ c {
      d += sc.nextInt();
      ary[c] = d;
    } {
      d += sc.nextInt();
      ary[c] = d;
    } d += sc.nextInt() d sc.nextInt() sc.nextInt sc ary[c] = d ary[c] ary c d for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    } int c = 0; int c = 0; c 0 c<=n c n c++ c++ c {
      if(ary[c]<=x)cnt++;
    } {
      if(ary[c]<=x)cnt++;
    } if(ary[c]<=x)cnt++; ary[c]<=x ary[c] ary c x cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt 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 ary[] = new int[n+1];
    ary[0] = 0;
    int d = 0;
    int cnt = 0;
    for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    }
    for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    }
    System.out.println(cnt);
  } 
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int ary[] = new int[n+1];
    ary[0] = 0;
    int d = 0;
    int cnt = 0;
    for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    }
    for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    }
    System.out.println(cnt);
  } 
} 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 ary[] = new int[n+1];
    ary[0] = 0;
    int d = 0;
    int cnt = 0;
    for(int c = 1;c<=n;c++){
      d += sc.nextInt();
      ary[c] = d;
    }
    for(int c = 0;c<=n;c++){
      if(ary[c]<=x)cnt++;
    }
    System.out.println(cnt);
  } 
}