#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long pre = 0;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (pre) {
      ans += pre / k;
      pre = pre % k;
    }
    a[i] += pre;
    ans += a[i] / k;
    if (a[i] / k == 0 && pre) {
      ans++;
      pre = 0;
      continue;
    }
    pre = a[i] % k;
  }
  if (pre) ans++;
  cout << ans;
  return 0;
}
