#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
void gn(long long &x) {
  char c;
  while (c = getchar(), c < '0' || c > '9')
    ;
  for (x = 0; c >= '0' && c <= '9';
       x = (x << 3) + (x << 1) + c - '0', c = getchar())
    ;
}
int a[111];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int cnt = 0;
  int res = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    res += a[i];
  }
  if (res <= m) {
    printf("1");
    return 0;
  }
  int sum = 0;
  int cnt0 = 0;
  for (int i = 1; i <= n; i++) {
    if (sum <= m) {
      sum += a[i];
      cnt0++;
    }
    if (sum > m) {
      cnt++;
      sum = a[i];
      cnt0 = 1;
    }
  }
  printf("%d\n", cnt + 1);
  return 0;
}
