#include <bits/stdc++.h>
int main() {
  int n, m, a = 0, i, res = 0, r;
  scanf("%d%d", &n, &m);
  a = m;
  for (i = 1; i <= n; i++) {
    scanf("%d", &r);
    if (a >= r) {
      a -= r;
    } else {
      a = m;
      a -= r;
      res++;
    }
  }
  printf("%d", res + 1);
  return 0;
}
