import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String numbers[] = br.readLine().split(" ");
		int n = Integer.parseInt(numbers[0]);
		int x = Integer.parseInt(numbers[1]);
		String length[] = br.readLine().split(" ");
		int len[] = new int[n];
		for (int i = 0; i < n; i++) {
			len[i] = Integer.parseInt(length[i]);
		}
		int bounces[] = new int[n + 1];
		bounces[0] = 0;
		for (int j = 1; j <= len.length; j++) {
			bounces[j] = bounces[j - 1] + len[j - 1];
		}
		int count = 0;
		for (int k = 0; k < bounces.length; k++) {
			if (bounces[k] <= x) {
				count++;
			}
		}
		System.out.println(count);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String numbers[] = br.readLine().split(" ");
		int n = Integer.parseInt(numbers[0]);
		int x = Integer.parseInt(numbers[1]);
		String length[] = br.readLine().split(" ");
		int len[] = new int[n];
		for (int i = 0; i < n; i++) {
			len[i] = Integer.parseInt(length[i]);
		}
		int bounces[] = new int[n + 1];
		bounces[0] = 0;
		for (int j = 1; j <= len.length; j++) {
			bounces[j] = bounces[j - 1] + len[j - 1];
		}
		int count = 0;
		for (int k = 0; k < bounces.length; k++) {
			if (bounces[k] <= x) {
				count++;
			}
		}
		System.out.println(count);
	}

} Main public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String numbers[] = br.readLine().split(" ");
		int n = Integer.parseInt(numbers[0]);
		int x = Integer.parseInt(numbers[1]);
		String length[] = br.readLine().split(" ");
		int len[] = new int[n];
		for (int i = 0; i < n; i++) {
			len[i] = Integer.parseInt(length[i]);
		}
		int bounces[] = new int[n + 1];
		bounces[0] = 0;
		for (int j = 1; j <= len.length; j++) {
			bounces[j] = bounces[j - 1] + len[j - 1];
		}
		int count = 0;
		for (int k = 0; k < bounces.length; k++) {
			if (bounces[k] <= x) {
				count++;
			}
		}
		System.out.println(count);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String numbers[] = br.readLine().split(" ");
		int n = Integer.parseInt(numbers[0]);
		int x = Integer.parseInt(numbers[1]);
		String length[] = br.readLine().split(" ");
		int len[] = new int[n];
		for (int i = 0; i < n; i++) {
			len[i] = Integer.parseInt(length[i]);
		}
		int bounces[] = new int[n + 1];
		bounces[0] = 0;
		for (int j = 1; j <= len.length; j++) {
			bounces[j] = bounces[j - 1] + len[j - 1];
		}
		int count = 0;
		for (int k = 0; k < bounces.length; k++) {
			if (bounces[k] <= x) {
				count++;
			}
		}
		System.out.println(count);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String numbers[] = br.readLine().split(" "); numbers br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(numbers[0]); n Integer.parseInt(numbers[0]) Integer.parseInt Integer numbers[0] numbers 0 int x = Integer.parseInt(numbers[1]); x Integer.parseInt(numbers[1]) Integer.parseInt Integer numbers[1] numbers 1 String length[] = br.readLine().split(" "); length br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int len[] = new int[n]; len new int[n] n for (int i = 0; i < n; i++) {
			len[i] = Integer.parseInt(length[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			len[i] = Integer.parseInt(length[i]);
		} {
			len[i] = Integer.parseInt(length[i]);
		} len[i] = Integer.parseInt(length[i]) len[i] len i Integer.parseInt(length[i]) Integer.parseInt Integer length[i] length i int bounces[] = new int[n + 1]; bounces new int[n + 1] n + 1 n 1 bounces[0] = 0 bounces[0] bounces 0 0 for (int j = 1; j <= len.length; j++) {
			bounces[j] = bounces[j - 1] + len[j - 1];
		} int j = 1; int j = 1; j 1 j <= len.length j len.length len len.length j++ j++ j {
			bounces[j] = bounces[j - 1] + len[j - 1];
		} {
			bounces[j] = bounces[j - 1] + len[j - 1];
		} bounces[j] = bounces[j - 1] + len[j - 1] bounces[j] bounces j bounces[j - 1] + len[j - 1] bounces[j - 1] bounces j - 1 j 1 len[j - 1] len j - 1 j 1 int count = 0; count 0 for (int k = 0; k < bounces.length; k++) {
			if (bounces[k] <= x) {
				count++;
			}
		} int k = 0; int k = 0; k 0 k < bounces.length k bounces.length bounces bounces.length k++ k++ k {
			if (bounces[k] <= x) {
				count++;
			}
		} {
			if (bounces[k] <= x) {
				count++;
			}
		} if (bounces[k] <= x) {
				count++;
			} bounces[k] <= x bounces[k] bounces k x {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String numbers[] = br.readLine().split(" ");
		int n = Integer.parseInt(numbers[0]);
		int x = Integer.parseInt(numbers[1]);
		String length[] = br.readLine().split(" ");
		int len[] = new int[n];
		for (int i = 0; i < n; i++) {
			len[i] = Integer.parseInt(length[i]);
		}
		int bounces[] = new int[n + 1];
		bounces[0] = 0;
		for (int j = 1; j <= len.length; j++) {
			bounces[j] = bounces[j - 1] + len[j - 1];
		}
		int count = 0;
		for (int k = 0; k < bounces.length; k++) {
			if (bounces[k] <= x) {
				count++;
			}
		}
		System.out.println(count);
	}

}