#include <bits/stdc++.h>
int main() {
  int n, k, bb[200000], i, rub;
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; i++) scanf("%d", &bb[i]);
  for (i = rub = 0; i < n; i++) {
    if (bb[i] == 0)
      continue;
    else {
      rub += bb[i] / k;
      if (bb[i] % k != 0) {
        rub++;
        bb[i + 1] -= (k - bb[i] % k);
      }
      if (bb[i] < 0) bb[i] = 0;
    }
  }
  printf("%d", rub);
}
