import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;


	void doIt() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int l[] = new int[n + 1];
		l[0] = 0;
		for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		}
		int cnt = 0;
		for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		}
		System.out.println(cnt);
	}


	public static void main(String[] args) {
		new Main().doIt();
	}
} import java.util.*; util.* java public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;


	void doIt() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int l[] = new int[n + 1];
		l[0] = 0;
		for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		}
		int cnt = 0;
		for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		}
		System.out.println(cnt);
	}


	public static void main(String[] args) {
		new Main().doIt();
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int MOD = 1000000007; MOD 1000000007 final int MAX = Integer.MAX_VALUE; MAX Integer.MAX_VALUE Integer Integer.MAX_VALUE final long LMAX = Long.MAX_VALUE; LMAX Long.MAX_VALUE Long Long.MAX_VALUE void doIt() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int l[] = new int[n + 1];
		l[0] = 0;
		for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		}
		int cnt = 0;
		for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		}
		System.out.println(cnt);
	} doIt {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int l[] = new int[n + 1];
		l[0] = 0;
		for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		}
		int cnt = 0;
		for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		}
		System.out.println(cnt);
	} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int l[] = new int[n + 1]; l new int[n + 1] n + 1 n 1 l[0] = 0 l[0] l 0 0 for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		} {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		} l[i] = sc.nextInt() l[i] l i sc.nextInt() sc.nextInt sc l[i] += l[i - 1] l[i] l i l[i - 1] l i - 1 i 1 int cnt = 0; cnt 0 for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		} int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
			if(l[i] <= x)cnt++;
			else break;
		} {
			if(l[i] <= x)cnt++;
			else break;
		} if(l[i] <= x)cnt++;
			else break; l[i] <= x l[i] l i x cnt++ cnt break; System.out.println(cnt) System.out.println System.out System System.out cnt public static void main(String[] args) {
		new Main().doIt();
	} main {
		new Main().doIt();
	} new Main().doIt() new Main().doIt new Main() String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;


	void doIt() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int l[] = new int[n + 1];
		l[0] = 0;
		for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		}
		int cnt = 0;
		for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		}
		System.out.println(cnt);
	}


	public static void main(String[] args) {
		new Main().doIt();
	}
} public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;


	void doIt() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int l[] = new int[n + 1];
		l[0] = 0;
		for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		}
		int cnt = 0;
		for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		}
		System.out.println(cnt);
	}


	public static void main(String[] args) {
		new Main().doIt();
	}
} Main
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;


	void doIt() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int l[] = new int[n + 1];
		l[0] = 0;
		for(int i = 1; i <= n; i++) {
			l[i] = sc.nextInt();
			l[i] += l[i - 1];
		}
		int cnt = 0;
		for(int i = 0; i <= n; i++) {
			if(l[i] <= x)cnt++;
			else break;
		}
		System.out.println(cnt);
	}


	public static void main(String[] args) {
		new Main().doIt();
	}
}
