#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, lo;
  cin >> n >> k;
  long long sum = 0;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (long long i = 0; i < n - 1; i++) {
    long long div = arr[i] / k;
    if (div == 0) {
      sum += 1;
      lo = 0;
    } else {
      sum += arr[i] / k;
      lo = arr[i] % k;
    }
    arr[i + 1] += lo;
  }
  sum += ceil(arr[n - 1] / k);
  cout << sum;
}
