#include <bits/stdc++.h>
using namespace std;
vector<long long> a(200005);
long long n, k;
int main(int argc, const char* argv[]) {
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  long long left = 0;
  for (long long i = 1; i < n; i++) {
    ans += a[i] / k;
    if (a[i] % k) {
      ans++;
      left = k - a[i] % k;
      if (a[i + 1] >= left) {
        a[i + 1] -= left;
      } else
        a[i + 1] = 0;
    }
  }
  if (a[n] > 0) {
    ans += a[n] / k;
    if (a[n] % k > 0) {
      ans++;
    }
  }
  cout << ans;
}
