#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, res = 0, count = 0, temp;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> temp;
    count += temp;
    if (count > m) {
      count = temp;
      res++;
    }
  }
  res++;
  cout << res << endl;
  return 0;
}
