
import java.util.*;
import java.lang.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer x = Integer.parseInt(scanner.next());

        Integer[] l = new Integer[n];
        Integer[] d = new Integer[n + 1];

        for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        }

        d[0] = 0;
        for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        }

        int count = 0;
        for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        }

        System.out.println(count);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.util.stream.*; stream.* java.util public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer x = Integer.parseInt(scanner.next());

        Integer[] l = new Integer[n];
        Integer[] d = new Integer[n + 1];

        for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        }

        d[0] = 0;
        for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        }

        int count = 0;
        for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        }

        System.out.println(count);
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer x = Integer.parseInt(scanner.next());

        Integer[] l = new Integer[n];
        Integer[] d = new Integer[n + 1];

        for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        }

        d[0] = 0;
        for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        }

        int count = 0;
        for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        }

        System.out.println(count);
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer x = Integer.parseInt(scanner.next());

        Integer[] l = new Integer[n];
        Integer[] d = new Integer[n + 1];

        for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        }

        d[0] = 0;
        for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        }

        int count = 0;
        for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        }

        System.out.println(count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer n = Integer.parseInt(scanner.next()); n Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer x = Integer.parseInt(scanner.next()); x Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer[] l = new Integer[n]; l new Integer[n] n Integer[] d = new Integer[n + 1]; d new Integer[n + 1] n + 1 n 1 for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            l[i] = Integer.parseInt(scanner.next());
        } {
            l[i] = Integer.parseInt(scanner.next());
        } l[i] = Integer.parseInt(scanner.next()) l[i] l i Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner d[0] = 0 d[0] d 0 0 for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        } int i = 0; int i = 0; i 0 i < l.length i l.length l l.length i++ i++ i {
            d[i+1] = d[i] + l[i];
        } {
            d[i+1] = d[i] + l[i];
        } d[i+1] = d[i] + l[i] d[i+1] d i+1 i 1 d[i] + l[i] d[i] d i l[i] l i int count = 0; count 0 for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        } int i = 0; int i = 0; i 0 i < d.length i d.length d d.length 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 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 scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer x = Integer.parseInt(scanner.next());

        Integer[] l = new Integer[n];
        Integer[] d = new Integer[n + 1];

        for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        }

        d[0] = 0;
        for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        }

        int count = 0;
        for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        }

        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer x = Integer.parseInt(scanner.next());

        Integer[] l = new Integer[n];
        Integer[] d = new Integer[n + 1];

        for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        }

        d[0] = 0;
        for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        }

        int count = 0;
        for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        }

        System.out.println(count);
    }
} Main

import java.util.*;
import java.lang.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.parseInt(scanner.next());
        Integer x = Integer.parseInt(scanner.next());

        Integer[] l = new Integer[n];
        Integer[] d = new Integer[n + 1];

        for(int i = 0; i < n; i++) {
            l[i] = Integer.parseInt(scanner.next());
        }

        d[0] = 0;
        for(int i = 0; i < l.length; i++) {
            d[i+1] = d[i] + l[i];
        }

        int count = 0;
        for(int i = 0; i < d.length; i++) {
            if(d[i] <= x) count++;
        }

        System.out.println(count);
    }
}
