#include <bits/stdc++.h>
using namespace std;
struct FastIO {
  inline FastIO& operator>>(int& x) {
    x = 0;
    char f = 0, ch = getchar();
    while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
    while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
    return x = (f ? -x : x), *this;
  }
  inline FastIO& operator>>(long long& x) {
    x = 0;
    char f = 0, ch = getchar();
    while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
    while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
    return x = (f ? -x : x), *this;
  }
  inline FastIO& operator>>(double& x) {
    x = 0;
    char f = 0, ch = getchar();
    double d = 0.1;
    while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
    while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
    if (ch == '.') {
      ch = getchar();
      while (ch <= '9' && ch >= '0')
        x += d * (ch ^ 48), d *= 0.1, ch = getchar();
    }
    return x = (f ? -x : x), *this;
  }
} read;
void file() {}
unsigned int log2(int x) {
  unsigned int ret;
  __asm__ __volatile__("bsrl %1, %%eax" : "=a"(ret) : "m"(x));
  return ret;
}
inline long long mul(long long a, long long b) {
  long long d = (long long)(a * (double)b / (int)(1e9 + 7) + 0.5);
  long long ret = a * b - d * (int)(1e9 + 7);
  if (ret < 0) ret += (int)(1e9 + 7);
  return ret;
}
long long a[200020];
long long n, K;
int main() {
  file();
  long long i, j, k, x, y, z, ans = 0;
  read >> n >> K;
  for (i = 1; i <= n; i++) read >> a[i];
  for (i = n; i; i--)
    if (a[i]) {
      if (a[i] % K)
        x = min(K - a[i] % K, a[i - 1]);
      else
        x = 0;
      a[i] += x;
      a[i - 1] -= x;
      ans += (a[i] - 1) / K + 1;
    }
  cout << ans;
}
