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