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