#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 (cap > 0)
      d++;
    else
      d = 0;
    if (cap > k) {
      sum += cap / k;
      cap = cap - (cap / k) * k;
      if (cap > 0)
        d = 1;
      else
        d = 0;
    }
  }
  if (cap > 0) sum++;
  cout << sum << endl;
}
