#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<ll> del(n + 1);
  vector<ll> over(n + 1);
  for (int i = 1; i <= n; i++) {
    del[i] = (a[i] + over[i - 1]) / k;
    over[i] = (a[i] + over[i - 1]) % k;
    if (over[i - 1] > 0 && del[i] < 1 && i < n) {
      over[i] -= over[i - 1];
      del[i]++;
    }
  }
  ll s = 0;
  for (int i = 0; i <= n; i++) {
    s += del[i];
  }
  if (over[n] > 0) {
    s++;
  }
  cout << s << endl;
}
