#include <bits/stdc++.h>
int main() {
  int n, m, i, s, y, x, a[110] = {0}, j;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(a, 0, sizeof(a));
    s = j = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &x);
      s += x;
      if (s > m) {
        s -= a[j];
        j++;
      }
      a[j] += x;
    }
    printf("%d\n", j + 1);
  }
  return 0;
}
