#include <bits/stdc++.h>
using namespace std;
long long n, k, x, r, z, sol;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (r > 0) {
      x = x - k + r;
      sol++;
    }
    z = x / k;
    sol += z;
    r = x % k;
  }
  if (r > 0) {
    sol++;
  }
  cout << sol;
  return 0;
}
