#include <bits/stdc++.h>
const int maxn = 1e6 + 7;
using namespace std;
int a[maxn];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int las = 0;
  int t;
  for (int i = 1; i <= n; i++) {
    a[i] -= las;
    las = 0;
    if (a[i] > 0) {
      t = a[i] / k;
      if (a[i] % k == 0) {
        ans += t;
        las = 0;
      } else {
        ans += (t + 1);
        las = a[i] - k * t;
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
