#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long prev = a[0];
  long long curr = 0;
  long long total_bags = 0;
  for (long long i = 1; i < n; i++) {
    total_bags = total_bags + (prev / k);
    long long remaining_prev = prev % k;
    if (remaining_prev != 0) {
      total_bags++;
      long long add = k - remaining_prev;
      long long current = a[i];
      current = current - add;
      prev = max(0ll, current);
    } else {
      prev = a[i];
    }
  }
  if (prev != 0) {
    total_bags = total_bags + (prev + k - 1) / k;
  }
  cout << total_bags << "\n";
  return 0;
}
