#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, garbage, paketiki = 0, temp = 0;
  vector<long long> a;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> garbage;
    a.push_back(garbage);
  }
  for (int i = 0; i < a.size(); i++) {
    paketiki += (a[i] + temp) / k;
    if (a[i] + temp < k && temp) {
      paketiki++;
      temp = 0;
    } else if (i == a.size() - 1 && a[i] && a[i] + temp < k)
      paketiki++;
    else
      temp = (a[i] + temp) % k;
  }
  cout << paketiki;
  return 0;
}
