#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long temp = 0, bags = 0;
  if (n != 1) {
    for (long long i = 0; i < n - 1; i++) {
      temp = a[i] + a[i + 1];
      if (temp <= k && temp != 0) {
        bags++;
        a[i + 1] = 0;
      } else {
        bags += temp / k;
        a[i + 1] = temp % k;
      }
    }
  } else {
    bags = a[0] / k;
    a[0] = a[0] % k;
  }
  if (a[n - 1] != 0) {
    bags += 1;
  }
  cout << bags;
  return 0;
}
