#include <bits/stdc++.h>
using namespace std;
int get_int() {
  char c;
  int x = 0;
  while ((c = getchar()) < 33)
    ;
  while (c > 32) {
    x = x * 10 + (c - 48);
    c = getchar();
  }
  return x;
}
int inline min(int a, int b) { return a < b ? a : b; }
int inline max(int a, int b) { return a > b ? a : b; }
int main() {
  int n, m;
  int a[102];
  n = get_int();
  m = get_int();
  for (int i = 0; i < n; i++) {
    a[i] = get_int();
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    int c = a[i];
    if (c == m) {
      count++;
      continue;
    }
    i++;
    while (i < n && c <= m) {
      c += a[i++];
    }
    if (i != n || (i == n && c > m)) {
      count++;
      i -= 2;
    } else
      count++;
  }
  printf("%d\n", count);
  return 0;
}
