#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  long long ans = 0;
  long long pre = 0;
  for (int i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    long long need = (pre + k - 1) / k;
    x += pre;
    pre = 0;
    long long real = max(need, x / k);
    x -= real * k;
    ans += real;
    pre = max(x, 0LL);
  }
  if (pre != 0) {
    ans += (pre + k - 1) / k;
  }
  cout << ans << endl;
}
