import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    }   
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    }   
} Main public static void main(String[] args) {
        Scanner t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    } main {
        Scanner t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    } Scanner t = new Scanner(System.in); t new Scanner(System.in) int n = t.nextInt(); n t.nextInt() t.nextInt t int x = t.nextInt(); x t.nextInt() t.nextInt t int d[] = new int[n+1]; d new int[n+1] n+1 n 1 d[0] = 0 d[0] d 0 0 for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        } {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        } int y = t.nextInt(); y t.nextInt() t.nextInt t d[i+1] = d[i]+y d[i+1] d i+1 i 1 d[i]+y d[i] d i y int count = 0; count 0 for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
            if (d[i] <= x){
                count++;
            }
        } {
            if (d[i] <= x){
                count++;
            }
        } if (d[i] <= x){
                count++;
            } d[i] <= x d[i] d i x {
                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 t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    }   
} public class Main {

    public static void main(String[] args) {
        Scanner t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    }   
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    }   
}