#include <bits/stdc++.h>
using namespace std;
const int32_t Accepted = 0;
template <typename T>
void in(T& x) {
  static char ch;
  static bool neg;
  for (ch = neg = 0; ch < '0' || '9' < ch; neg |= ch == '-', ch = getchar())
    ;
  for (x = 0; '0' <= ch && ch <= '9'; (x *= 10) += ch - '0', ch = getchar())
    ;
  x = neg ? -x : x;
}
template <typename T, typename... Types>
void in(T& x, Types&... oth) {
  static char ch;
  static bool neg;
  for (ch = neg = 0; ch < '0' || '9' < ch; neg |= ch == '-', ch = getchar())
    ;
  for (x = 0; '0' <= ch && ch <= '9'; (x *= 10) += ch - '0', ch = getchar())
    ;
  x = neg ? -x : x;
  in(oth...);
}
template <typename T>
T _pow_mod(T a, T b, T mod) {
  T base = a, res = 1;
  while (b) {
    if (b & 1) res = (res * base) % mod;
    base = (base * base) % mod;
    b >>= 1;
  }
  return res;
}
template <typename T>
T _pow(T a, T b) {
  T base = a, res = 1;
  while (b) {
    if (b & 1) res = (res * base);
    base = (base * base);
    b >>= 1;
  }
  return res;
}
template <typename T>
void out(T x) {
  char s[65];
  int32_t cnt = 0;
  if (x > 0)
    while (x > 0) s[cnt++] = (x - (x / 10 * 10)) + '0', x /= 10;
  else if (x < 0) {
    while (x < 0) s[cnt++] = (x / 10 * 10) - x + '0', x /= 10;
    s[cnt++] = '-';
  }
  if (cnt == 0)
    putchar('0');
  else
    for (int32_t i = cnt - 1; ~i; i--) putchar(s[i]);
}
template <typename T>
void print(T x) {
  out(x);
  putchar('\n');
}
template <typename T, typename... types>
void print(T x, types... oth) {
  out(x);
  putchar(' ');
  print(oth...);
}
const int32_t MAXN = 1e6 + 5;
int a[MAXN];
int32_t main() {
  int n, k;
  in(n, k);
  for (int i = 0; i < n; i++) in(a[i]);
  long long cnt = 0;
  int pre = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] >= pre) {
      a[i] -= pre;
      pre = 0;
    } else {
      a[i] = 0;
      pre -= a[i];
    }
    cnt += a[i] / k;
    if (a[i] % k) {
      cnt++;
      pre += k - (a[i] % k);
    }
  }
  print(cnt);
  return Accepted;
}
