import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int [] list = new int [n + 1];
		list[0] = 0;

		for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		}
		int ans = 0;
		for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int [] list = new int [n + 1];
		list[0] = 0;

		for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		}
		int ans = 0;
		for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int [] list = new int [n + 1];
		list[0] = 0;

		for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		}
		int ans = 0;
		for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int [] list = new int [n + 1];
		list[0] = 0;

		for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		}
		int ans = 0;
		for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		}
		System.out.println(ans);
	} 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 [] list = new int [n + 1]; list new int [n + 1] n + 1 n 1 list[0] = 0 list[0] list 0 0 for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		} {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		} list[i] = sc.nextInt() list[i] list i sc.nextInt() sc.nextInt sc list[i] += list[i-1] list[i] list i list[i-1] list i-1 i 1 int ans = 0; ans 0 for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		} int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
			if( list[i] <= x) ans++;
			else break;
		} {
			if( list[i] <= x) ans++;
			else break;
		} if( list[i] <= x) ans++;
			else break; list[i] <= x list[i] list i x ans++ ans break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int [] list = new int [n + 1];
		list[0] = 0;

		for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		}
		int ans = 0;
		for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int [] list = new int [n + 1];
		list[0] = 0;

		for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		}
		int ans = 0;
		for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int [] list = new int [n + 1];
		list[0] = 0;

		for(int i = 1; i <= n; i++) {
			list[i] = sc.nextInt();
			list[i] += list[i-1];
		}
		int ans = 0;
		for(int i = 0; i <= n; i++) {
			if( list[i] <= x) ans++;
			else break;
		}
		System.out.println(ans);
	}
}