#include <bits/stdc++.h>
using namespace std;
int num[105];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    int sum = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &num[i]);
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (sum + num[i] <= m) {
        sum += num[i];
        continue;
      }
      ans++;
      sum = num[i];
    }
    ans++;
    printf("%d\n", ans);
  }
  return 0;
}
