#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<int> vec;
  int v;
  for (int i = 0; i < n; i++) {
    cin >> v;
    vec.push_back(v);
  }
  long long ans = 0, rem = 0;
  for (int i = 0; i < n; i++) {
    vec[i] -= rem;
    if (vec[i] < 0) {
      rem = 0;
      continue;
    }
    int req = vec[i] / k + !!(vec[i] % k);
    if (vec[i] % k)
      rem = k - (vec[i] % k);
    else
      rem = 0;
    ans += req;
  }
  cout << ans << '\n';
  return 0;
}
