#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, k, i, j, c = 0, temp;
  cin >> n >> k;
  long long int a[n];
  cin >> a[0];
  for (i = 1; i < n; i++) {
    cin >> a[i];
    if (a[i - 1] != 0) {
      temp = ceil((long double)a[i - 1] / k);
      if (temp * k > a[i - 1]) {
        a[i] -= min(a[i], (temp * k) - a[i - 1]);
      }
      c += temp;
    }
  }
  if (a[n - 1] != 0) c += ceil((long double)a[n - 1] / k);
  cout << c;
  return 0;
}
