#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[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;
  for (int i = 1; i <= n; i++) {
    long long dans = (a[i] + b[i]) / k;
    ans += dans;
    long long dtrash = dans * k;
    if (dtrash >= b[i]) {
      dtrash -= b[i];
      b[i + 1] = a[i] - dtrash;
    } else {
      ++ans;
      dtrash = dtrash + k - b[i];
      b[i + 1] = max(a[i] - dtrash, 0LL);
    }
  }
  if (b[n + 1]) ans++;
  cout << ans << endl;
}
