#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  char c;
  int sign = 1;
  x = 0;
  do {
    c = getchar();
    if (c == '-') sign = -1;
  } while (!isdigit(c));
  do {
    x = x * 10 + c - '0';
    c = getchar();
  } while (isdigit(c));
  x *= sign;
}
int n, k, lst;
long long ans;
int main() {
  read(n);
  read(k);
  for (register int i = 1; i <= n; ++i) {
    int x;
    read(x);
    if (lst) x -= k - lst, ++ans;
    if (x <= 0) {
      lst = 0;
      continue;
    }
    ans += x / k;
    x %= k;
    lst = x;
  }
  ans += lst > 0;
  cout << ans << endl;
  return 0;
}
