import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

            System.out.println(count);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

            System.out.println(count);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

            System.out.println(count);
        } {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

            System.out.println(count);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int X = in.nextInt(); X in.nextInt() in.nextInt in int[] L = new int[N]; L new int[N] N for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                L[i] = in.nextInt();
            } {
                L[i] = in.nextInt();
            } L[i] = in.nextInt() L[i] L i in.nextInt() in.nextInt in int[] D = new int[N + 1]; D new int[N + 1] N + 1 N 1 for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            } int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
                D[i] = D[i - 1] + L[i - 1];
            } {
                D[i] = D[i - 1] + L[i - 1];
            } D[i] = D[i - 1] + L[i - 1] D[i] D i D[i - 1] + L[i - 1] D[i - 1] D 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 (D[i] <= X) {
                    count++;
                }
            } int i = 0; int i = 0; i 0 i < N + 1 i N + 1 N 1 i++ i++ i {
                if (D[i] <= X) {
                    count++;
                }
            } {
                if (D[i] <= X) {
                    count++;
                }
            } if (D[i] <= X) {
                    count++;
                } D[i] <= X D[i] D 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) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

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

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int X = in.nextInt();
            int[] L = new int[N];
            for (int i = 0; i < N; i++) {
                L[i] = in.nextInt();
            }

            int[] D = new int[N + 1];
            for (int i = 1; i < N + 1; i++) {
                D[i] = D[i - 1] + L[i - 1];
            }

            int count = 0;
            for (int i = 0; i < N + 1; i++) {
                if (D[i] <= X) {
                    count++;
                }
            }

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