#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k;
  int i, j;
  cin >> n >> k;
  vector<long long> a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  a.push_back(0);
  long long ans = 0, ctr;
  for (i = 0; i < n; i++) {
    ctr = a[i] + a[i + 1];
    if (a[i] == 0) {
      continue;
    }
    if (ctr <= k) {
      ans++;
      a[i + 1] = 0;
      continue;
    }
    ans += ctr / k;
    a[i + 1] = ctr % k;
  }
  cout << ans << endl;
  return 0;
}
