#include <bits/stdc++.h>
using namespace std;
void Update(vector<int>& arr, int k, int i, long long& ans, int n) {
  int d = arr[i - 1] % k;
  int cur = 0;
  if (d != 0) {
    cur += arr[i - 1] / k + 1;
  } else {
    cur += arr[i - 1] / k;
  }
  ans += cur;
  int r = k * cur - arr[i - 1];
  arr[i] -= r;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      if (arr[i] < k) {
        continue;
      } else {
        ans += 1;
        arr[i] = arr[i] - k;
        continue;
      }
    }
    if (arr[i - 1] != 0) {
      if (arr[i - 1] > k) {
        Update(arr, k, i, ans, n);
      } else {
        ans += 1;
        int r = k - arr[i - 1];
        arr[i] -= r;
      }
    } else {
      arr[i] -= k;
      ans++;
      continue;
    }
    if (i == n - 1 && arr[i] > 0) {
      Update(arr, k, i, ans, n);
    }
  }
  cout << ans << endl;
}
