#include <bits/stdc++.h>
using namespace std;
int n, k, a[(int)2e5 + 10];
int main() {
  cin >> n >> k;
  for (int i = 2; i <= n + 1; i++) {
    scanf("%d", &a[i]);
  }
  long long ans = 0;
  long long now = 0;
  for (int i = n + 1; i >= 2; i--) {
    if (a[i] == 0) {
      continue;
    }
    now = a[i] + a[i - 1];
    ans += now / k;
    now %= k;
    a[i] = 0;
    if (a[i - 1] >= now)
      a[i - 1] = now;
    else {
      ans++;
      a[i - 1] = 0;
    }
  }
  cout << ans << endl;
}
