#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void in(T &x) {
  x = 0;
  bool f = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ '0'), c = getchar();
  if (f) x = -x;
}
long long a[200005];
long long b[200005];
long long n, k;
long long ans;
signed main() {
  in(n);
  in(k);
  for (register long long i = 1; i <= n; ++i) {
    in(a[i]);
    long long t = (a[i] + b[i]) / k;
    if (t * k >= b[i]) {
      ans += t;
      t *= k;
      t -= b[i];
      b[i] = 0;
      a[i] -= t;
      b[i + 1] += a[i];
    } else {
      t = (b[i] + k - 1) / k;
      ans += t;
      t *= k;
      t -= b[i];
      a[i] -= t;
      a[i] = max(a[i], 0ll);
      b[i + 1] += a[i];
    }
  }
  ans += (b[n + 1] + k - 1) / k;
  printf("%lld", ans);
  return 0;
}
