#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int tg = 0, pg = 0;
  long long int bags = 0;
  long long int days = 0;
  for (int i = 0; i < n; i++) {
    cin >> tg;
    long long int totg = tg + pg;
    if (totg / k > 0) {
      bags += totg / k;
      pg = totg % k;
      continue;
    } else if (pg != 0) {
      bags++;
      pg = 0;
      continue;
    } else {
      pg = tg;
    }
  }
  if (pg != 0) {
    if (pg % k != 0) {
      bags++;
    }
    bags += pg / k;
  }
  cout << bags;
}
