#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, pre = 0, now, ans = 0;
  cin >> n >> k;
  for (long i = 0; i < n; i++) {
    cin >> now;
    if (pre) {
      now -= k - pre;
      ans++;
    }
    ans += now / k;
    pre = now % k;
  }
  if (pre) ans++;
  cout << ans << endl;
  return 0;
}
