#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int n, k, x, v;
long long int sol;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (v) x -= (k - v);
    x = max(x, 0);
    v = x % k;
    sol += (x % k == 0) ? x / k : x / k + 1;
  }
  cout << sol << "\n";
  return 0;
}
