#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int m, i, a[n], ct = 0, p = 0;
    cin >> m;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (p + a[i] <= m)
        p += a[i];
      else {
        ct++;
        p = a[i];
      }
    }
    cout << ct + 1 << endl;
  }
}
