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