#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;
  bag += a[0] / k;
  prev = a[0] % k;
  for (int i = 1; i < n; i++) {
    if (prev + a[i] <= k && prev + a[i] > 0) {
      bag++;
      prev = 0;
    } else {
      a[i] = prev + a[i];
      bag += a[i] / k;
      prev = a[i] % k;
    }
  }
  cout << bag << endl;
}
