import java.util.*;

class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		
		Integer[] array = new Integer[n];
		for(int i = 0; i < n; ++i) {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		}
		
		Integer[] array_pon = new Integer[n+1];
		array_pon[0] = 0;
		int sum = 0;
		for(int i = 1; i < n+1; ++i) {
		    sum += array[i-1];
		    array_pon[i] = sum;
		}
		
		int counter = 0;
		for(int i = 0; i < n+1; ++i) {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		}
		
		System.out.println(counter);	
	}
} import java.util.*; util.* java class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		
		Integer[] array = new Integer[n];
		for(int i = 0; i < n; ++i) {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		}
		
		Integer[] array_pon = new Integer[n+1];
		array_pon[0] = 0;
		int sum = 0;
		for(int i = 1; i < n+1; ++i) {
		    sum += array[i-1];
		    array_pon[i] = sum;
		}
		
		int counter = 0;
		for(int i = 0; i < n+1; ++i) {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		}
		
		System.out.println(counter);	
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		
		Integer[] array = new Integer[n];
		for(int i = 0; i < n; ++i) {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		}
		
		Integer[] array_pon = new Integer[n+1];
		array_pon[0] = 0;
		int sum = 0;
		for(int i = 1; i < n+1; ++i) {
		    sum += array[i-1];
		    array_pon[i] = sum;
		}
		
		int counter = 0;
		for(int i = 0; i < n+1; ++i) {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		}
		
		System.out.println(counter);	
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		
		Integer[] array = new Integer[n];
		for(int i = 0; i < n; ++i) {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		}
		
		Integer[] array_pon = new Integer[n+1];
		array_pon[0] = 0;
		int sum = 0;
		for(int i = 1; i < n+1; ++i) {
		    sum += array[i-1];
		    array_pon[i] = sum;
		}
		
		int counter = 0;
		for(int i = 0; i < n+1; ++i) {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		}
		
		System.out.println(counter);	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int x = Integer.parseInt(sc.next()); x Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Integer[] array = new Integer[n]; array new Integer[n] n for(int i = 0; i < n; ++i) {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		} int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		} {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		} int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc array[i] = tmp array[i] array i tmp Integer[] array_pon = new Integer[n+1]; array_pon new Integer[n+1] n+1 n 1 array_pon[0] = 0 array_pon[0] array_pon 0 0 int sum = 0; sum 0 for(int i = 1; i < n+1; ++i) {
		    sum += array[i-1];
		    array_pon[i] = sum;
		} int i = 1; int i = 1; i 1 i < n+1 i n+1 n 1 ++i ++i i {
		    sum += array[i-1];
		    array_pon[i] = sum;
		} {
		    sum += array[i-1];
		    array_pon[i] = sum;
		} sum += array[i-1] sum array[i-1] array i-1 i 1 array_pon[i] = sum array_pon[i] array_pon i sum int counter = 0; counter 0 for(int i = 0; i < n+1; ++i) {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		} int i = 0; int i = 0; i 0 i < n+1 i n+1 n 1 ++i ++i i {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		} {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		} if(array_pon[i] <= x) ++counter;
		    else continue; array_pon[i] <= x array_pon[i] array_pon i x ++counter counter continue; System.out.println(counter) System.out.println System.out System System.out counter String[] args args
import java.util.*;

class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		
		Integer[] array = new Integer[n];
		for(int i = 0; i < n; ++i) {
		    int tmp = sc.nextInt();
		    array[i] = tmp;
		}
		
		Integer[] array_pon = new Integer[n+1];
		array_pon[0] = 0;
		int sum = 0;
		for(int i = 1; i < n+1; ++i) {
		    sum += array[i-1];
		    array_pon[i] = sum;
		}
		
		int counter = 0;
		for(int i = 0; i < n+1; ++i) {
		    if(array_pon[i] <= x) ++counter;
		    else continue;
		}
		
		System.out.println(counter);	
	}
}