#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, k, n, i;
  scanf("%lld", &n);
  scanf("%lld", &k);
  long long int ar[n];
  long long int ans = 0;
  for (i = 0; i < n; i++) {
    scanf("%lld", &ar[i]);
  }
  long long int prev = 0;
  for (i = 0; i < n; i++) {
    if ((ar[i] + prev) < k) {
      ans++;
      prev = 0;
    } else {
      ar[i] += prev;
      ans += ar[i] / k;
      prev = ar[i] % k;
    }
  }
  if (prev) ans++;
  cout << ans << "\n";
}
