#include <bits/stdc++.h>
int main() {
  int m, n, i, j, a, ans, num;
  while (scanf("%d%d", &n, &m) != -1) {
    num = 0;
    ans = 1;
    for (i = 1; i <= n; i++) {
      scanf("%d", &a);
      if (num + a > m) {
        ans++;
        num = 0;
      }
      num += a;
    }
    printf("%d\n", ans);
  }
  return 0;
}
