#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, q, i, j, k, l, cnt = 0, p, m;
  cin >> n >> q;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    if (a[i] > 0) {
      p = a[i] / q;
      if (p == 0) p += 1;
      cnt += p;
      m = a[i] % q;
      if (a[i] < q) m = -m;
      if (i != n - 1) a[i + 1] += m;
    }
  }
  cout << cnt << endl;
}
