#include <bits/stdc++.h>
using namespace std;
long long a[200002], n, k, bag = 0, ans;
;
signed main() {
  bool kt = false;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) {
    bag += a[i];
    if (bag < k) {
      if (!kt) {
        kt = true;
        continue;
      } else {
        kt = false;
        ++ans;
        bag = 0;
      }
    } else {
      long long x = bag / k;
      ans += x;
      bag -= x * k;
      if (bag == 0)
        kt = false;
      else
        kt = true;
    }
  }
  cout << ans + (bag != 0);
}
