import java.util.*;
public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int data[] = new int[n];
    int total[] = new int[n+1];
    int count = 0 ;
    total[0] = 0;

    for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    }

    for (int i = 0 ; i < n+1 ; i++ ) {
      if (total[i] <= x) {
        count++;
      }
    }
    System.out.println(count);
  }
} import java.util.*; util.* java public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int data[] = new int[n];
    int total[] = new int[n+1];
    int count = 0 ;
    total[0] = 0;

    for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    }

    for (int i = 0 ; i < n+1 ; i++ ) {
      if (total[i] <= x) {
        count++;
      }
    }
    System.out.println(count);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int data[] = new int[n];
    int total[] = new int[n+1];
    int count = 0 ;
    total[0] = 0;

    for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    }

    for (int i = 0 ; i < n+1 ; i++ ) {
      if (total[i] <= x) {
        count++;
      }
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int data[] = new int[n];
    int total[] = new int[n+1];
    int count = 0 ;
    total[0] = 0;

    for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    }

    for (int i = 0 ; i < n+1 ; i++ ) {
      if (total[i] <= x) {
        count++;
      }
    }
    System.out.println(count);
  } 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 data[] = new int[n]; data new int[n] n int total[] = new int[n+1]; total new int[n+1] n+1 n 1 int count = 0 ; count 0 total[0] = 0 total[0] total 0 0 for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
      data[i] = sc.nextInt();
    } {
      data[i] = sc.nextInt();
    } data[i] = sc.nextInt() data[i] data i sc.nextInt() sc.nextInt sc for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
      total[i+1] = data[i] + total[i];
    } {
      total[i+1] = data[i] + total[i];
    } total[i+1] = data[i] + total[i] total[i+1] total i+1 i 1 data[i] + total[i] data[i] data i total[i] total i for (int i = 0 ; i < n+1 ; i++ ) {
      if (total[i] <= x) {
        count++;
      }
    } int i = 0 ; int i = 0 ; i 0 i < n+1 i n+1 n 1 i++ i++ i {
      if (total[i] <= x) {
        count++;
      }
    } {
      if (total[i] <= x) {
        count++;
      }
    } if (total[i] <= x) {
        count++;
      } total[i] <= x total[i] total i x {
        count++;
      } count++ count 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) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int data[] = new int[n];
    int total[] = new int[n+1];
    int count = 0 ;
    total[0] = 0;

    for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    }

    for (int i = 0 ; i < n+1 ; i++ ) {
      if (total[i] <= x) {
        count++;
      }
    }
    System.out.println(count);
  }
} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int data[] = new int[n];
    int total[] = new int[n+1];
    int count = 0 ;
    total[0] = 0;

    for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    }

    for (int i = 0 ; i < n+1 ; i++ ) {
      if (total[i] <= x) {
        count++;
      }
    }
    System.out.println(count);
  }
} Main
import java.util.*;
public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int data[] = new int[n];
    int total[] = new int[n+1];
    int count = 0 ;
    total[0] = 0;

    for (int i = 0 ; i < n ; i++ ) {
      data[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n; i++ ) {
      total[i+1] = data[i] + total[i];
    }

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