#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  long long prev = 0, bags = 0;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (prev) {
      long long extra = min(a, k - prev);
      bags++;
      prev = 0;
      a -= extra;
    }
    bags += a / k;
    prev = a % k;
  }
  if (prev) bags++;
  cout << bags << endl;
  return 0;
}
