#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (auto i = 0; i < n; ++i) cin >> a[i];
  long long s = 0;
  long long left = 0;
  long long lst = -1;
  for (auto i = 0; i < n; ++i) {
    if (i == lst + 2 and (left + a[i]) / k == 0) {
      s += ceil((double)left / k);
      left = 0;
      lst = i;
    } else {
      s += (left + a[i]) / k;
      left += a[i] % k;
      lst = i;
    }
  }
  s += ceil((double)left / k);
  cout << s;
}
