#include <bits/stdc++.h>
using namespace std;
long long n, k;
int main() {
  cin >> n >> k;
  long long res = 0, u, r = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> u;
    if (r) u = max(u - (k - r), 0LL);
    res += u / k;
    r = u % k;
    res += r > 0;
  }
  cout << res;
}
