#include <bits/stdc++.h>
int main() {
  int a, b, c, d, e, x[200001], sum = 0;
  scanf("%d%d", &a, &b);
  for (c = 0; c < a; c++) {
    scanf("%d", &x[c]);
  }
  for (c = 0; c < a; c++) {
    while (x[c] > 0) {
      x[c] = x[c] - b;
      sum++;
    }
    if (x[c] < 0 && x[c - 1] < 0) {
      x[c] = 0;
    }
    x[c + 1] = x[c] + x[c + 1];
  }
  printf("%d", sum);
}
