#include <bits/stdc++.h>
int x[101];
int a, N, M, counter;
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%d", &x[i]);
  }
  a = 0;
  counter = 1;
  for (int i = 0; i < N; i++) {
    a += x[i];
    if (a > M) {
      counter++;
      a = x[i];
    }
  }
  printf("%d", counter);
  return 0;
}
