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