#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, k, p;
  long long t = 0;
  bool m = true;
  cin >> n >> k;
  vector<int> v(n + 1);
  v[n] = 0;
  for (i = 0; i < n; i++) {
    cin >> v[i];
  }
  for (i = 0; i < n;) {
    if (v[i] < k && v[i] != 0) {
      if (v[i + 1]) {
        v[i + 1] += v[i];
        v[i] = 0;
        i++;
      } else {
        t++;
        i++;
      }
    } else {
      if (v[i] >= k) {
        p = v[i] / k;
        t += p;
        v[i] = v[i] - p * k;
      }
      if (!v[i]) i++;
    }
  }
  cout << t;
  return 0;
}
