#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[113], n, m, s = 0, m1;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  m1 = m;
  for (int i = 1; i <= n; i++) {
    m1 -= a[i];
    if (m1 < 0) {
      m1 = m;
      s++;
      m1 -= a[i];
    }
  }
  cout << s + 1;
  return 0;
}
