#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k, sum = 0, val, rem = 0;
  cin >> n >> k;
  vector<long long> v;
  for (long long i = 0; i < n; i++) {
    cin >> val;
    v.push_back(val);
  }
  for (long long i = 0; i < n; i++) {
    if (rem == 0) {
      sum += (v[i] / k);
      rem = v[i] % k;
    } else {
      sum++;
      v[i] -= (k - rem);
      rem = 0;
      if (v[i] > 0) {
        sum += (v[i] / k);
        rem = (v[i] % k);
      }
    }
  }
  if (rem) sum++;
  cout << sum << endl;
  return 0;
}
