import java.util.*;
 
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+1]; 
        int D = 0;
        int count = 1;
        int ans = N+1;
        for(int i = 1; i <= N; i++) {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        }
        
        System.out.println(ans);
    }
} import java.util.*; util.* java 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+1]; 
        int D = 0;
        int count = 1;
        int ans = N+1;
        for(int i = 1; i <= N; i++) {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        }
        
        System.out.println(ans);
    }
} 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+1]; 
        int D = 0;
        int count = 1;
        int ans = N+1;
        for(int i = 1; i <= N; i++) {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        }
        
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());
        int[] L = new int[N+1]; 
        int D = 0;
        int count = 1;
        int ans = N+1;
        for(int i = 1; i <= N; i++) {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        }
        
        System.out.println(ans);
    } 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+1]; L new int[N+1] N+1 N 1 int D = 0; D 0 int count = 1; count 1 int ans = N+1; ans N+1 N 1 for(int i = 1; i <= N; i++) {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        } {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        } L[i] = Integer.parseInt(sc.next()) L[i] L i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc D += L[i] D L[i] L i count++ count if(D > X) {
                ans = count-1;
                break;
            } D > X D X {
                ans = count-1;
                break;
            } ans = count-1 ans count-1 count 1 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
 
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+1]; 
        int D = 0;
        int count = 1;
        int ans = N+1;
        for(int i = 1; i <= N; i++) {
            L[i] = Integer.parseInt(sc.next());
            D += L[i];
            count++;
            if(D > X) {
                ans = count-1;
                break;
            }
        }
        
        System.out.println(ans);
    }
}