#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long ans = 0;
  bool tag = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= k) {
      ans += a[i] / k;
      a[i + 1] += a[i] % k;
      if (a[i] % k) tag = 1;
      a[i] = 0;
    } else {
      if (tag) {
        if (a[i]) ans++;
        tag = 0;
      } else {
        ans += a[i] / k;
        a[i + 1] += a[i] % k;
        if (a[i] % k) tag = 1;
        a[i] = 0;
      }
    }
  }
  if (a[n + 1]) ans++;
  cout << ans << endl;
}
