#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, sum = 0;
  cin >> n >> k;
  vector<long long> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  for (int i = 0; i < n; i++) {
    long long c = a[i] / k, r = a[i] % k;
    if (r <= b[i] && i + 1 < n) {
      a[i + 1] += r;
      a[i] -= r;
    } else {
      if (r > 0) {
        sum += 1;
      }
    }
    sum += c;
  }
  cout << sum << "\n";
  return 0;
}
