import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * AtCoder Beginner Contest 130<br>
 * B - Bounding<br>
 * https://atcoder.jp/contests/abc130/tasks/abc130_b<br>
 */
public class Main {

    public static void main(String[] args) {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    }

    private static int calc(int N, int X, List<Integer> list) {
        int ans = 0;
        int count = 1;
        for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    }

    private static int calc(int N, int X, List<Integer> list) {
        int ans = 0;
        int count = 1;
        for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    }
} Main public static void main(String[] args) {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    } main {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    } String[] input1; input1 String[] input2; input2 try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) input1 = sc.nextLine().split(" ") input1 sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " input2 = sc.nextLine().split(" ") input2 sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int N = Integer.parseInt(input1[0]); N Integer.parseInt(input1[0]) Integer.parseInt Integer input1[0] input1 0 int X = Integer.parseInt(input1[1]); X Integer.parseInt(input1[1]) Integer.parseInt Integer input1[1] input1 1 List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for (String str : input2) {
                list.add(Integer.parseInt(str));
            } String str input2 {
                list.add(Integer.parseInt(str));
            } {
                list.add(Integer.parseInt(str));
            } list.add(Integer.parseInt(str)) list.add list Integer.parseInt(str) Integer.parseInt Integer str int result = calc(N, X, list); result calc(N, X, list) calc N X list System.out.println(result) System.out.println System.out System System.out result String[] args args private static int calc(int N, int X, List<Integer> list) {
        int ans = 0;
        int count = 1;
        for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    } calc {
        int ans = 0;
        int count = 1;
        for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    } int ans = 0; ans 0 int count = 1; count 1 for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        } {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        } ans = ans + list.get(i) ans ans + list.get(i) ans list.get(i) list.get list i if (X < ans) {
                break;
            } X < ans X ans {
                break;
            } break; count++ count return count; count int N N int X X List<Integer> list list public class Main {

    public static void main(String[] args) {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    }

    private static int calc(int N, int X, List<Integer> list) {
        int ans = 0;
        int count = 1;
        for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    }
} public class Main {

    public static void main(String[] args) {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    }

    private static int calc(int N, int X, List<Integer> list) {
        int ans = 0;
        int count = 1;
        for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * AtCoder Beginner Contest 130<br>
 * B - Bounding<br>
 * https://atcoder.jp/contests/abc130/tasks/abc130_b<br>
 */
public class Main {

    public static void main(String[] args) {

        String[] input1;
        String[] input2;

        try (Scanner sc = new Scanner(System.in)) {
            input1 = sc.nextLine().split(" ");
            input2 = sc.nextLine().split(" ");

            int N = Integer.parseInt(input1[0]);
            int X = Integer.parseInt(input1[1]);

            List<Integer> list = new ArrayList<Integer>();
            for (String str : input2) {
                list.add(Integer.parseInt(str));
            }
            // 計算
            int result = calc(N, X, list);

            // 出力
            System.out.println(result);
        } 
    }

    private static int calc(int N, int X, List<Integer> list) {
        int ans = 0;
        int count = 1;
        for (int i = 0; i < N; i++) {
            ans = ans + list.get(i);
            if (X < ans) {
                break;
            }
            count++;
        }
        return count;
    }
}