#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  int n;
  long long k;
  long long cur;
  scanf("%d%lld%lld", &n, &k, &cur);
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    long long y = cur % k;
    if (y > 0) y = k - y;
    y = min(y, x);
    cur += y;
    ans += (cur + k - 1) / k;
    cur = x - y;
  }
  ans += (cur + k - 1) / k;
  printf("%lld\n", ans);
  return 0;
}
