#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, k;
const int maxn = 2e5 + 100;
ll a[maxn];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
    ll ans = 0;
    for (int i = 2; i <= n; i++) {
      if ((a[i] + a[i - 1] < k) && a[i - 1] != 0) {
        ans++;
        a[i] = 0;
      } else {
        ans += (a[i] + a[i - 1]) / k;
        a[i] = (a[i] + a[i - 1]) % k;
      }
    }
    if (a[n]) ans++;
    printf("%lld\n", ans);
  }
  return 0;
}
