import java.util.*;
import java.math.*;

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];
    int[] data = new int[n+1];

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

    data[0] = 0;

    for (int i = 1; i < n+1; i++) {
      data[i] = data[i-1] + l[i-1];
    }

    int count = 0;

    for (int i = 0; i < n+1; i++) {
      if (data[i] <= x) {
        count++;
      }
    }

    System.out.println(count);

  }

} import java.util.*; util.* java import java.math.*; math.* 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];
    int[] data = new int[n+1];

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

    data[0] = 0;

    for (int i = 1; i < n+1; i++) {
      data[i] = data[i-1] + l[i-1];
    }

    int count = 0;

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

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

    data[0] = 0;

    for (int i = 1; i < n+1; i++) {
      data[i] = data[i-1] + l[i-1];
    }

    int count = 0;

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

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

    data[0] = 0;

    for (int i = 1; i < n+1; i++) {
      data[i] = data[i-1] + l[i-1];
    }

    int count = 0;

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

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

    data[0] = 0;

    for (int i = 1; i < n+1; i++) {
      data[i] = data[i-1] + l[i-1];
    }

    int count = 0;

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

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

    data[0] = 0;

    for (int i = 1; i < n+1; i++) {
      data[i] = data[i-1] + l[i-1];
    }

    int count = 0;

    for (int i = 0; i < n+1; i++) {
      if (data[i] <= x) {
        count++;
      }
    }

    System.out.println(count);

  }

} Main
import java.util.*;
import java.math.*;

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];
    int[] data = new int[n+1];

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

    data[0] = 0;

    for (int i = 1; i < n+1; i++) {
      data[i] = data[i-1] + l[i-1];
    }

    int count = 0;

    for (int i = 0; i < n+1; i++) {
      if (data[i] <= x) {
        count++;
      }
    }

    System.out.println(count);

  }

}
