#include <bits/stdc++.h>
using namespace std;
long long asd[200005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long z, x;
  cin >> z >> x;
  long long total = 0;
  bool cek = false;
  long long sisa = 0;
  for (int q = 1; q <= z; q++) {
    cin >> asd[q];
    if (cek == true) {
      asd[q] = asd[q] - min(sisa, asd[q]);
      sisa = sisa + (min(sisa, asd[q]));
      total += asd[q] / x;
      cek = false;
      sisa = 0;
      if (asd[q] % x != 0) {
        total++;
        cek = true;
        sisa = asd[q] % x;
      }
    } else {
      total += (asd[q] / x);
      if (asd[q] % x != 0) {
        total++;
        cek = true;
        sisa = asd[q] % x;
      }
    }
  }
  cout << total << endl;
}
