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[] l = new int[n + 1];
    int total = 0;
    int count = 0;

    for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    }

    for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      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[] l = new int[n + 1];
    int total = 0;
    int count = 0;

    for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    }

    for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      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[] l = new int[n + 1];
    int total = 0;
    int count = 0;

    for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    }

    for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      count++;
    }
    System.out.println(count);


  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int[] l = new int[n + 1];
    int total = 0;
    int count = 0;

    for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    }

    for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      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[] l = new int[n + 1]; l new int[n + 1] n + 1 n 1 int total = 0; total 0 int count = 0; count 0 for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    } int i = 1; int i = 1; i 1 i < n + 1 i n + 1 n 1 i++ i++ i {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    } {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    } l[0] = 0 l[0] l 0 0 total += sc.nextInt() total sc.nextInt() sc.nextInt sc l[i] = total l[i] l i total for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      count++;
    } int i = 0; int i = 0; i 0 i < n + 1 i n + 1 n 1 i++ i++ i {
      if(l[i] > x) break;
      count++;
    } {
      if(l[i] > x) break;
      count++;
    } if(l[i] > x) break; l[i] > x l[i] l i x break; 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[] l = new int[n + 1];
    int total = 0;
    int count = 0;

    for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    }

    for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      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[] l = new int[n + 1];
    int total = 0;
    int count = 0;

    for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    }

    for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      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[] l = new int[n + 1];
    int total = 0;
    int count = 0;

    for(int i = 1;i < n + 1;i++) {
      l[0] = 0;
      total += sc.nextInt();
      l[i] = total;
    }

    for(int i = 0;i < n + 1;i++) {
      if(l[i] > x) break;
      count++;
    }
    System.out.println(count);


  }

}
