#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;
}
int a[105];
int main() {
  int n, m, ans = 0, buf = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i <= n; i++) {
    if (buf <= m) buf += a[i];
    if (buf == m) {
      ans++;
      buf = 0;
    }
    if (buf > m) {
      ans++;
      buf = a[i];
    }
  }
  if (buf) ans++;
  cout << ans;
  return 0;
}
