#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int ans = 0;
  int n, k;
  cin >> n >> k;
  long long int bag, arr[n], i;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  bag = 0;
  for (i = 0; i < n; i++) {
    if (bag) {
      ans++;
      arr[i] -= (k - bag);
      bag = 0;
    }
    if (arr[i] > 0) ans += arr[i] / k;
    if (arr[i] > 0 && arr[i] % k) {
      bag += arr[i] % k;
    }
  }
  if (bag) {
    ans++;
    arr[i] - (k - bag);
    bag = 0;
  }
  cout << ans << endl;
}
