#include <bits/stdc++.h>
using namespace std;
int n, k, a[200005];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int remain = 0;
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    int v = (remain + k - 1) / k;
    res += v;
    remain = remain + a[i] - v * k;
    if (remain < 0) remain = 0;
  }
  res += (remain + k - 1) / k;
  printf("%lld\n", res);
  return 0;
}
