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