#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long na = 0, res = 0, tm;
  for (long long i = 0; i < n; i++) {
    cin >> tm;
    if (i != n - 1) {
      long long q = (res + k - 1) / k;
      na += q;
      q = q * k - res;
      tm -= q;
      if (tm >= 0)
        res = tm;
      else
        res = 0;
    } else {
      res += tm;
      na += (res + k - 1) / k;
    }
  }
  cout << na;
}
