#include <bits/stdc++.h>
using namespace std;
long long n, k, i, a[1000009], cnt, adm;
int main() {
  cin >> n >> k;
  for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (i = 0; i < n - 1; i++) {
    if (adm == 0) {
      cnt += (a[i] / k);
      adm = a[i] % k;
    } else if (a[i] + adm <= k) {
      cnt++;
      adm = 0;
    } else {
      cnt += ((adm + a[i]) / k);
      adm = (adm + a[i]) % k;
    }
  }
  cnt += (a[i] + adm) / k;
  if ((a[i] + adm) % k) cnt++;
  cout << cnt << endl;
  return 0;
}
