import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N, X;
		N = sc.nextInt();
		X = sc.nextInt();
		int L[] = new int[N + 1];

		for (int i = 0; i < N; i++) {
			L[i] = sc.nextInt();
		}
		sc.close();

		int a = 0;
		int b = 0;
		for (int i = 0; i < N + 1; i++) {
			if (a <= X) {
				a += L[i];
				b++;
			}

		}
		System.out.println(b);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N, X;
		N = sc.nextInt();
		X = sc.nextInt();
		int L[] = new int[N + 1];

		for (int i = 0; i < N; i++) {
			L[i] = sc.nextInt();
		}
		sc.close();

		int a = 0;
		int b = 0;
		for (int i = 0; i < N + 1; i++) {
			if (a <= X) {
				a += L[i];
				b++;
			}

		}
		System.out.println(b);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N, X;
		N = sc.nextInt();
		X = sc.nextInt();
		int L[] = new int[N + 1];

		for (int i = 0; i < N; i++) {
			L[i] = sc.nextInt();
		}
		sc.close();

		int a = 0;
		int b = 0;
		for (int i = 0; i < N + 1; i++) {
			if (a <= X) {
				a += L[i];
				b++;
			}

		}
		System.out.println(b);
	} main {
		Scanner sc = new Scanner(System.in);
		int N, X;
		N = sc.nextInt();
		X = sc.nextInt();
		int L[] = new int[N + 1];

		for (int i = 0; i < N; i++) {
			L[i] = sc.nextInt();
		}
		sc.close();

		int a = 0;
		int b = 0;
		for (int i = 0; i < N + 1; i++) {
			if (a <= X) {
				a += L[i];
				b++;
			}

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

		} int i = 0; int i = 0; i 0 i < N + 1 i N + 1 N 1 i++ i++ i {
			if (a <= X) {
				a += L[i];
				b++;
			}

		} {
			if (a <= X) {
				a += L[i];
				b++;
			}

		} if (a <= X) {
				a += L[i];
				b++;
			} a <= X a X {
				a += L[i];
				b++;
			} a += L[i] a L[i] L i b++ b System.out.println(b) System.out.println System.out System System.out b String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N, X;
		N = sc.nextInt();
		X = sc.nextInt();
		int L[] = new int[N + 1];

		for (int i = 0; i < N; i++) {
			L[i] = sc.nextInt();
		}
		sc.close();

		int a = 0;
		int b = 0;
		for (int i = 0; i < N + 1; i++) {
			if (a <= X) {
				a += L[i];
				b++;
			}

		}
		System.out.println(b);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N, X;
		N = sc.nextInt();
		X = sc.nextInt();
		int L[] = new int[N + 1];

		for (int i = 0; i < N; i++) {
			L[i] = sc.nextInt();
		}
		sc.close();

		int a = 0;
		int b = 0;
		for (int i = 0; i < N + 1; i++) {
			if (a <= X) {
				a += L[i];
				b++;
			}

		}
		System.out.println(b);
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N, X;
		N = sc.nextInt();
		X = sc.nextInt();
		int L[] = new int[N + 1];

		for (int i = 0; i < N; i++) {
			L[i] = sc.nextInt();
		}
		sc.close();

		int a = 0;
		int b = 0;
		for (int i = 0; i < N + 1; i++) {
			if (a <= X) {
				a += L[i];
				b++;
			}

		}
		System.out.println(b);
	}

}
