import java.util.*;
import java.lang.Object;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] num = new int[n+1];
        num[0] = 0;
        int cnt = 0;

        for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        }

        for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        }
        System.out.println(cnt);

        


    }
} import java.util.*; util.* java import java.lang.Object; Object java.lang public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] num = new int[n+1];
        num[0] = 0;
        int cnt = 0;

        for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        }

        for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        }
        System.out.println(cnt);

        


    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] num = new int[n+1];
        num[0] = 0;
        int cnt = 0;

        for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        }

        for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        }
        System.out.println(cnt);

        


    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] num = new int[n+1];
        num[0] = 0;
        int cnt = 0;

        for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        }

        for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        }
        System.out.println(cnt);

        


    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int[] num = new int[n+1]; num new int[n+1] n+1 n 1 num[0] = 0 num[0] num 0 0 int cnt = 0; cnt 0 for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        } int i = 1; int i = 1; i 1 i<n+1 i n+1 n 1 i++ i++ i {
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        } {
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        } int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc num[i]+=num[i-1]+l num[i] num i num[i-1]+l num[i-1] num i-1 i 1 l for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        } int i = 0; int i = 0; i 0 i<n+1 i n+1 n 1 i++ i++ i {
            if(num[i]<=x){
                cnt++;
            }
        } {
            if(num[i]<=x){
                cnt++;
            }
        } if(num[i]<=x){
                cnt++;
            } num[i]<=x num[i] num i x {
                cnt++;
            } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] num = new int[n+1];
        num[0] = 0;
        int cnt = 0;

        for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        }

        for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        }
        System.out.println(cnt);

        


    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] num = new int[n+1];
        num[0] = 0;
        int cnt = 0;

        for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        }

        for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        }
        System.out.println(cnt);

        


    }
} Main
import java.util.*;
import java.lang.Object;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] num = new int[n+1];
        num[0] = 0;
        int cnt = 0;

        for(int i = 1;i<n+1;i++){
            int l = sc.nextInt();
            num[i]+=num[i-1]+l;
          //  System.out.println(num[i]);
        }

        for(int i = 0;i<n+1;i++){
            if(num[i]<=x){
                cnt++;
            }
        }
        System.out.println(cnt);

        


    }
}
