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[] arr = new int[N];
		int output = 0;
		for(int i = 0;i<N;i++)arr[i]=sc.nextInt();
		int temp = 0;
		if(0<=X)output++;
		for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		}
		System.out.println(output);

	}

} 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[] arr = new int[N];
		int output = 0;
		for(int i = 0;i<N;i++)arr[i]=sc.nextInt();
		int temp = 0;
		if(0<=X)output++;
		for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		}
		System.out.println(output);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] arr = new int[N];
		int output = 0;
		for(int i = 0;i<N;i++)arr[i]=sc.nextInt();
		int temp = 0;
		if(0<=X)output++;
		for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		}
		System.out.println(output);

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] arr = new int[N];
		int output = 0;
		for(int i = 0;i<N;i++)arr[i]=sc.nextInt();
		int temp = 0;
		if(0<=X)output++;
		for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		}
		System.out.println(output);

	} 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[] arr = new int[N]; arr new int[N] N int output = 0; output 0 for(int i = 0;i<N;i++)arr[i]=sc.nextInt(); int i = 0; int i = 0; i 0 i<N i N i++ i++ i arr[i]=sc.nextInt(); arr[i]=sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc int temp = 0; temp 0 if(0<=X)output++; 0<=X 0 X output++ output for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
			temp+=arr[i];
			if(temp<=X)output++;
		} {
			temp+=arr[i];
			if(temp<=X)output++;
		} temp+=arr[i] temp arr[i] arr i if(temp<=X)output++; temp<=X temp X output++ output System.out.println(output) System.out.println System.out System System.out output 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[] arr = new int[N];
		int output = 0;
		for(int i = 0;i<N;i++)arr[i]=sc.nextInt();
		int temp = 0;
		if(0<=X)output++;
		for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		}
		System.out.println(output);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] arr = new int[N];
		int output = 0;
		for(int i = 0;i<N;i++)arr[i]=sc.nextInt();
		int temp = 0;
		if(0<=X)output++;
		for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		}
		System.out.println(output);

	}

} 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[] arr = new int[N];
		int output = 0;
		for(int i = 0;i<N;i++)arr[i]=sc.nextInt();
		int temp = 0;
		if(0<=X)output++;
		for(int i = 0;i<N;i++) {
			temp+=arr[i];
			if(temp<=X)output++;
		}
		System.out.println(output);

	}

}
