import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args){
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] sum = new int[n+1];
        for (int i=0; i<n; i++) l[i] = sc.nextInt();
        for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1];

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

        System.out.println(res);
    }


} import java.util.*; util.* java public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args){
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] sum = new int[n+1];
        for (int i=0; i<n; i++) l[i] = sc.nextInt();
        for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1];

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

        System.out.println(res);
    }


} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args){
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] sum = new int[n+1];
        for (int i=0; i<n; i++) l[i] = sc.nextInt();
        for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1];

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

        System.out.println(res);
    } run {

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] sum = new int[n+1];
        for (int i=0; i<n; i++) l[i] = sc.nextInt();
        for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1];

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

        System.out.println(res);
    } 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[] sum = new int[n+1]; sum 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] l i sc.nextInt() sc.nextInt sc for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1]; int i=1; int i=1; i 1 i<n+1 i n+1 n 1 i++ i++ i sum[i] = sum[i-1] + l[i-1]; sum[i] = sum[i-1] + l[i-1] sum[i] sum i sum[i-1] + l[i-1] sum[i-1] sum i-1 i 1 l[i-1] l i-1 i 1 int res = 0; res 0 for (int i=0; i<n+1; i++) {
            if (sum[i] <= x) res++;
        } int i=0; int i=0; i 0 i<n+1 i n+1 n 1 i++ i++ i {
            if (sum[i] <= x) res++;
        } {
            if (sum[i] <= x) res++;
        } if (sum[i] <= x) res++; sum[i] <= x sum[i] sum i x res++ res System.out.println(res) System.out.println System.out System System.out res public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args){
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] sum = new int[n+1];
        for (int i=0; i<n; i++) l[i] = sc.nextInt();
        for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1];

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

        System.out.println(res);
    }


} public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args){
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] sum = new int[n+1];
        for (int i=0; i<n; i++) l[i] = sc.nextInt();
        for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1];

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

        System.out.println(res);
    }


} Main
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args){
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] l = new int[n];
        int[] sum = new int[n+1];
        for (int i=0; i<n; i++) l[i] = sc.nextInt();
        for (int i=1; i<n+1; i++) sum[i] = sum[i-1] + l[i-1];

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

        System.out.println(res);
    }


}
