#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  cin >> n >> k;
  long long sum = 0;
  long long temp;
  long long arr[n];
  long long remainder;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    sum += arr[i] / k;
    remainder = arr[i] % k;
    if (remainder > 0) {
      sum++;
      if (i < n - 1) {
        arr[i + 1] =
            (arr[i + 1] > (k - remainder)) ? (arr[i + 1] - (k - remainder)) : 0;
      }
    }
  }
  cout << sum << endl;
  return 0;
}
