#include <bits/stdc++.h>
using namespace std;
const int INF_of_int = 1e9;
const long long INF_of_ll = 1e18;
template <typename T>
void Read(T &x) {
  bool w = 1;
  x = 0;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') w = 0, c = getchar();
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  if (!w) x = -x;
}
template <typename T>
void Write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) Write(x / 10);
  putchar(x % 10 + '0');
}
const int N = 3e5 + 10;
long long a[N], n, k, ans = 0;
int main() {
  Read(n), Read(k);
  for (int i = 1; i <= n; ++i) Read(a[i]);
  for (int i = 1; i <= n - 1; ++i) {
    if (!a[i]) continue;
    long long num = a[i] / k;
    if (a[i] % k) ++num;
    a[i + 1] = max(0ll, a[i + 1] - (num * k - a[i]));
    ans += num;
  }
  if (a[n]) {
    ans += a[n] / k;
    if (a[n] % k) ++ans;
  }
  Write(ans);
  return 0;
}
