#include <bits/stdc++.h>
using namespace std;
int n, m, ans = 1, now, x;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    now += x;
    if (now > m) {
      ans++;
      now = x;
    }
  }
  printf("%d", ans);
  return 0;
}
