
import java.util.Scanner;

public 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());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        int p = 0;
        int count =0;
        for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        }
        if(p<=x){
            count++;
        }
        System.out.println(count);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public 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());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        int p = 0;
        int count =0;
        for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        }
        if(p<=x){
            count++;
        }
        System.out.println(count);
        sc.close();
    }
} 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());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        int p = 0;
        int count =0;
        for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        }
        if(p<=x){
            count++;
        }
        System.out.println(count);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        int p = 0;
        int count =0;
        for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        }
        if(p<=x){
            count++;
        }
        System.out.println(count);
        sc.close();
    } 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 int[] l = new int[n]; l new int[n] n for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            l[i] = Integer.parseInt(sc.next());
        } {
            l[i] = Integer.parseInt(sc.next());
        } l[i] = Integer.parseInt(sc.next()) l[i] l i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int p = 0; p 0 int count =0; count 0 for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        } {
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        } if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            } p<=x p x {
                count++;
                p+=l[i];
            } count++ count p+=l[i] p l[i] l i {
                break;
            } break; if(p<=x){
            count++;
        } p<=x p x {
            count++;
        } count++ count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public 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());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        int p = 0;
        int count =0;
        for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        }
        if(p<=x){
            count++;
        }
        System.out.println(count);
        sc.close();
    }
} public 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());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        int p = 0;
        int count =0;
        for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        }
        if(p<=x){
            count++;
        }
        System.out.println(count);
        sc.close();
    }
} Main

import java.util.Scanner;

public 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());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        int p = 0;
        int count =0;
        for(int i=0;i<n;i++){
            if(p<=x){
                count++;
                p+=l[i];
            }else{
                break;
            }
        }
        if(p<=x){
            count++;
        }
        System.out.println(count);
        sc.close();
    }
}