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