#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, c;
  cin >> n >> c;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) cin >> vec[i];
  long long nob = 0, i = 0, cw = 0, leftover = 0;
  while (i < n) {
    cw = leftover;
    cw += vec[i];
    int x = 0;
    if (i + 1 < n) {
      cw += vec[i + 1];
      if (vec[i + 1] == 0) x = (cw % c == 0 ? 0 : 1);
    }
    nob += cw / c + x;
    if (i + 1 < n && vec[i + 1] == 0)
      leftover = 0;
    else
      leftover = cw % c;
    i += 2;
  }
  nob += leftover / c + (leftover % c == 0 ? 0 : 1);
  cout << nob;
  cout << endl;
  return 0;
}
