#include <bits/stdc++.h>
using namespace std;
int n;
long long k, a;
long long sum, cap, d;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    if (d == 2) {
      d = 0;
      sum++;
      cap = 0;
    }
    cin >> a;
    cap += a;
    if (a > 0 && cap > 0) d++;
    if (cap > k) {
      sum += cap / k;
      cap = cap - (cap / k) * k;
      d = 0;
    }
  }
  if (cap > 0) sum++;
  cout << sum << endl;
}
