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