import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        int cnt = n <= x ? 1 : 0, cur = 0, temp;
        for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        }
        System.out.printf("%d\n", cnt);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        int cnt = n <= x ? 1 : 0, cur = 0, temp;
        for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        }
        System.out.printf("%d\n", cnt);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        int cnt = n <= x ? 1 : 0, cur = 0, temp;
        for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        }
        System.out.printf("%d\n", cnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        int cnt = n <= x ? 1 : 0, cur = 0, temp;
        for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        }
        System.out.printf("%d\n", cnt);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int cnt = n <= x ? 1 : 0 cnt n <= x ? 1 : 0 n <= x n x 1 0 cur = 0 cur 0 temp; temp for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        } int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        } {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        } temp = sc.nextInt() temp sc.nextInt() sc.nextInt sc cur += temp cur temp if (cur <= x) ++cnt; cur <= x cur x ++cnt cnt System.out.printf("%d\n", cnt) System.out.printf System.out System System.out "%d\n" cnt String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        int cnt = n <= x ? 1 : 0, cur = 0, temp;
        for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        }
        System.out.printf("%d\n", cnt);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        int cnt = n <= x ? 1 : 0, cur = 0, temp;
        for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        }
        System.out.printf("%d\n", cnt);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        int cnt = n <= x ? 1 : 0, cur = 0, temp;
        for (int i = 0; i < n; ++i) {
            temp = sc.nextInt();
            cur += temp;
            if (cur <= x) ++cnt;
        }
        System.out.printf("%d\n", cnt);
    }
}