#include <bits/stdc++.h>
using namespace std;
long long a[200007];
int32_t main() {
  long long n, k;
  cin >> n >> k;
  long long x, sum = 0, r;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long bag = 0;
  long long car = 0;
  if (a[0] >= k) {
    r = a[0] / k;
    bag += r;
    a[0] -= (r * k);
  }
  for (long long i = 1; i < n; i++) {
    if (a[i - 1] > 0) {
      a[i] += a[i - 1];
      if (a[i] >= k) {
        r = a[i] / k;
        bag += r;
        a[i] -= r * k;
      } else {
        bag++;
        a[i] = 0;
      }
    } else {
      r = a[i] / k;
      bag += r;
      a[i] -= r * k;
    }
  }
  if (a[n - 1] > 0) {
    bag++;
  }
  cout << bag << endl;
  return 0;
}
