#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, x, rem = 0;
  cin >> n >> k;
  int64_t res = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (rem > 0) {
      res++;
      x = max(x - k + rem, 0);
    }
    res += x / k;
    rem = x % k;
  }
  cout << res + (rem > 0) << endl;
  return 0;
}
