#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  vector<long long> a;
  long long ai;
  long long garbage = 0;
  long long sum = 0;
  int counter = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> ai;
    a.push_back(ai);
  }
  for (int i = 0; i < n; i++) {
    garbage += a[i];
    if (garbage < k && i != n - 1 && garbage > 0) {
      counter++;
    }
    if (counter == 2 && garbage < k) {
      garbage = 0;
      sum++;
      counter = 0;
    }
    if (garbage >= k) {
      sum += garbage / k;
      garbage -= k * (garbage / k);
      counter = 0;
    }
    if (garbage < k && i == n - 1 && garbage > 0) {
      sum++;
      garbage = 0;
      counter = 0;
    }
  }
  cout << sum << endl;
  return 0;
}
