#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  long long n, k, i, j, x, bag = 0, extra = 0, cur = 0;
  cin >> n >> k;
  int a[n + 10];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i] % k == 0 and i == 0) {
      bag += (a[i] / k);
      continue;
    }
    if (a[i] % k != 0 and i == 0) {
      bag += (a[i] / k);
      x = a[i] / k;
      x++;
      extra = abs(a[i] - (x * k));
      continue;
    }
    cur = extra + a[i];
    if (cur < k) {
      if (extra > 0) bag++;
      extra = a[i];
    } else if (cur % k == 0) {
      bag += (cur / k);
      extra = 0;
    } else {
      bag += (cur / k);
      x = cur / k;
      extra = cur - (k * x);
    }
  }
  x = extra + a[n - 1];
  if (x % k == 0) {
    bag += x / k;
  } else {
    bag += (x / k) + 1;
  }
  cout << bag << endl;
}
