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];
		for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		}
		int now = 0;
		int count= 0;

		for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		}

		System.out.println(count);
	}
} 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];
		for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		}
		int now = 0;
		int count= 0;

		for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		}

		System.out.println(count);
	}
} 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];
		for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		}
		int now = 0;
		int count= 0;

		for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		}

		System.out.println(count);
	} main {

		Scanner sc = new Scanner (System.in);

		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] list = new int[N];
		for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		}
		int now = 0;
		int count= 0;

		for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		}

		System.out.println(count);
	} 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]; list new int[N] N for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		} int index=0; int index=0; index 0 index<N index N index++ index++ index {
			list[index]=sc.nextInt();
		} {
			list[index]=sc.nextInt();
		} list[index]=sc.nextInt() list[index] list index sc.nextInt() sc.nextInt sc int now = 0; now 0 int count= 0; count 0 for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		} int index=0; int index=0; index 0 index<N index N index++ index++ index {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		} {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		} if (index==0&&list[index]>X) {
				count++;
				break;
			} index==0&&list[index]>X index==0 index 0 list[index]>X list[index] list index X {
				count++;
				break;
			} count++ count break; now+=list[index] now list[index] list index if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			} now>X now X {
				count++;
				break;
			} count++ count break; if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			} index+1==N index+1 index 1 N {
				count+=2;
				break;
			} count+=2 count 2 break; {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count 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];
		for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		}
		int now = 0;
		int count= 0;

		for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		}

		System.out.println(count);
	}
} 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];
		for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		}
		int now = 0;
		int count= 0;

		for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		}

		System.out.println(count);
	}
} 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];
		for (int index=0; index<N; index++) {
			list[index]=sc.nextInt();
		}
		int now = 0;
		int count= 0;

		for (int index=0; index<N; index++) {
			if (index==0&&list[index]>X) {
				count++;
				break;
			}
			now+=list[index];
			if (now>X) {
				count++;
				break;
			} else if (index+1==N) {
				count+=2;
				break;
			} else {
				count++;
			}

		}

		System.out.println(count);
	}
}
