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