#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long prev = 0, bag = 0;
  for (int i = 0; i < n; i++) {
    a[i] = a[i] + prev;
    if (a[i] > 0) {
      if (a[i] <= k && prev > 0) {
        bag++;
        prev = 0;
      } else {
        bag += a[i] / k;
        prev = a[i] % k;
      }
    }
  }
  if (prev > 0) bag++;
  cout << bag << endl;
}
