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