import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    int[] l = new int[n];
    int[] d = new int[n+1];
    int count = 0;
    str = in.readLine().split(" ");
    d[0] = 0;
    for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    }
    for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    }
    System.out.println(count);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    int[] l = new int[n];
    int[] d = new int[n+1];
    int count = 0;
    str = in.readLine().split(" ");
    d[0] = 0;
    for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    }
    for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    }
    System.out.println(count);
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    int[] l = new int[n];
    int[] d = new int[n+1];
    int count = 0;
    str = in.readLine().split(" ");
    d[0] = 0;
    for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    }
    for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    }
    System.out.println(count);
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    int[] l = new int[n];
    int[] d = new int[n+1];
    int count = 0;
    str = in.readLine().split(" ");
    d[0] = 0;
    for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    }
    for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    }
    System.out.println(count);
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int n = Integer.parseInt(str[0]); n Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int x = Integer.parseInt(str[1]); x Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int[] l = new int[n]; l new int[n] n int[] d = new int[n+1]; d new int[n+1] n+1 n 1 int count = 0; count 0 str = in.readLine().split(" ") str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " d[0] = 0 d[0] d 0 0 for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    } {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    } l[i] = Integer.parseInt(str[i]) l[i] l i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str 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 for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    } int j=0; int j=0; j 0 j<=n j n j++ j++ j {
      if(d[j]<=x)
        count+=1;
    } {
      if(d[j]<=x)
        count+=1;
    } if(d[j]<=x)
        count+=1; d[j]<=x d[j] d j x count+=1 count 1 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) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    int[] l = new int[n];
    int[] d = new int[n+1];
    int count = 0;
    str = in.readLine().split(" ");
    d[0] = 0;
    for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    }
    for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    }
    System.out.println(count);
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    int[] l = new int[n];
    int[] d = new int[n+1];
    int count = 0;
    str = in.readLine().split(" ");
    d[0] = 0;
    for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    }
    for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    }
    System.out.println(count);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    int[] l = new int[n];
    int[] d = new int[n+1];
    int count = 0;
    str = in.readLine().split(" ");
    d[0] = 0;
    for(int i=0; i<n; i++) {
      l[i] = Integer.parseInt(str[i]);
      d[i+1] = d[i] + l[i];
    }
    for(int j=0; j<=n; j++) {
      if(d[j]<=x)
        count+=1;
    }
    System.out.println(count);
  }
}