
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] j = new int[N + 1];
		j[0] = 0;
		for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		}
		int ans = 0;
		for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] j = new int[N + 1];
		j[0] = 0;
		for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		}
		int ans = 0;
		for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] j = new int[N + 1];
		j[0] = 0;
		for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		}
		int ans = 0;
		for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] j = new int[N + 1];
		j[0] = 0;
		for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		}
		int ans = 0;
		for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	} 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[] input = new int[N]; input new int[N] N for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
			input[i] = sc.nextInt();
		} {
			input[i] = sc.nextInt();
		} input[i] = sc.nextInt() input[i] input i sc.nextInt() sc.nextInt sc int[] j = new int[N + 1]; j new int[N + 1] N + 1 N 1 j[0] = 0 j[0] j 0 0 for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		} int i = 1; int i = 1; i 1 i < j.length i j.length j j.length i++ i++ i {
			j[i] = j[i - 1] + input[i - 1];
		} {
			j[i] = j[i - 1] + input[i - 1];
		} j[i] = j[i - 1] + input[i - 1] j[i] j i j[i - 1] + input[i - 1] j[i - 1] j i - 1 i 1 input[i - 1] input i - 1 i 1 int ans = 0; ans 0 for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		} int i = 0; int i = 0; i 0 i < j.length i j.length j j.length i++ i++ i {
			if (j[i] <= X)
				ans++;
		} {
			if (j[i] <= X)
				ans++;
		} if (j[i] <= X)
				ans++; j[i] <= X j[i] j i X ans++ ans System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] j = new int[N + 1];
		j[0] = 0;
		for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		}
		int ans = 0;
		for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] j = new int[N + 1];
		j[0] = 0;
		for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		}
		int ans = 0;
		for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	}
} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] j = new int[N + 1];
		j[0] = 0;
		for (int i = 1; i < j.length; i++) {
			j[i] = j[i - 1] + input[i - 1];
		}
		int ans = 0;
		for (int i = 0; i < j.length; i++) {
			if (j[i] <= X)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	}
}