#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, ans = 0;
  scanf("%d%d", &n, &m);
  int a[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int k = 0, flag = 0;
  for (i = 0; i < n; i++) {
    k = k + a[i];
    if (k > m) {
      k = a[i];
      ans++;
    }
  }
  ans++;
  cout << ans;
}
