#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a[100], x = 0, z = 0;
  cin >> n >> k;
  for (size_t i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (size_t i = 0; i < n; i++) {
    z += a[i];
    if (z <= k) {
      continue;
    } else {
      z = a[i];
      x++;
    }
  }
  cout << ++x << endl;
}
