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