import java.util.*; import java.io.*; //comment out when submitting public class l { Scanner in = new Scanner(System.in); // static Scanner in = null; public static void main(String[] args) { // //comment out this part // try { // File file = new File("input.txt"); // in = new Scanner(file); // } catch(FileNotFoundException e) { // System.out.println("error"); // } new l().go(); } private void go() { //read the input int n = in.nextInt(); int t = in.nextInt(); int[] time = new int[n]; for(int i = 0; i < n; i++) { time[i] = in.nextInt(); } int count = 0; for(int i = 0; i < n; i ++) { t = t - time[i]; if (t < 0) { break; } else { count += 1; } } System.out.println(count); } }