#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read(T& x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
const int N = 2e5 + 10;
int n, k, i, cnt, a[N];
long long ans, pre;
int main() {
  read(n), read(k);
  for (i = 1; i <= n; ++i) {
    read(a[i]);
    if (i > 1 && pre + a[i] < k)
      ans++, pre = 0;
    else {
      pre += a[i];
      ans += pre / k;
      pre %= k;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
