import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int X = input.nextInt();

        int[] L = new int[n];

        for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        }
        int[] D = new int[n + 1];
        D[0] = 0;
        for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        }
        int count = 0;
        for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int X = input.nextInt();

        int[] L = new int[n];

        for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        }
        int[] D = new int[n + 1];
        D[0] = 0;
        for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        }
        int count = 0;
        for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int X = input.nextInt();

        int[] L = new int[n];

        for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        }
        int[] D = new int[n + 1];
        D[0] = 0;
        for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        }
        int count = 0;
        for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        }
        System.out.println(count);
    } main {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int X = input.nextInt();

        int[] L = new int[n];

        for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        }
        int[] D = new int[n + 1];
        D[0] = 0;
        for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        }
        int count = 0;
        for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        }
        System.out.println(count);
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int n = input.nextInt(); n input.nextInt() input.nextInt input int X = input.nextInt(); X input.nextInt() input.nextInt input int[] L = new int[n]; L new int[n] n for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        } int i = 0; int i = 0; i 0 i < L.length i L.length L L.length i++ i++ i {
            L[i] = input.nextInt();;
        } {
            L[i] = input.nextInt();;
        } L[i] = input.nextInt() L[i] L i input.nextInt() input.nextInt input int[] D = new int[n + 1]; D new int[n + 1] n + 1 n 1 D[0] = 0 D[0] D 0 0 for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        } int j = 1; int j = 1; j 1 j < D.length j D.length D D.length j++ j++ j {
            D[j] = D[j - 1] + L[j - 1];
        } {
            D[j] = D[j - 1] + L[j - 1];
        } D[j] = D[j - 1] + L[j - 1] D[j] D j D[j - 1] + L[j - 1] D[j - 1] D j - 1 j 1 L[j - 1] L j - 1 j 1 int count = 0; count 0 for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        } int k = 0; int k = 0; k 0 k < D.length k D.length D D.length k++ k++ k {
            if (D[k] <= X) {
                count += 1;
            }

        } {
            if (D[k] <= X) {
                count += 1;
            }

        } if (D[k] <= X) {
                count += 1;
            } D[k] <= X D[k] D k X {
                count += 1;
            } count += 1 count 1 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 input = new Scanner(System.in);

        int n = input.nextInt();
        int X = input.nextInt();

        int[] L = new int[n];

        for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        }
        int[] D = new int[n + 1];
        D[0] = 0;
        for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        }
        int count = 0;
        for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        }
        System.out.println(count);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int X = input.nextInt();

        int[] L = new int[n];

        for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        }
        int[] D = new int[n + 1];
        D[0] = 0;
        for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        }
        int count = 0;
        for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        }
        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int X = input.nextInt();

        int[] L = new int[n];

        for (int i = 0; i < L.length; i++) {
            L[i] = input.nextInt();;
        }
        int[] D = new int[n + 1];
        D[0] = 0;
        for (int j = 1; j < D.length; j++) {
            D[j] = D[j - 1] + L[j - 1];
        }
        int count = 0;
        for (int k = 0; k < D.length; k++) {
            if (D[k] <= X) {
                count += 1;
            }

        }
        System.out.println(count);
    }
}