#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int prev = 0;
  long long int n_bags = 0;
  for (int i = 0; i < n; i++) {
    long long to_be_dropped = 0;
    long long unit_space = 0;
    if (prev != 0) {
      to_be_dropped = prev;
      unit_space = k - prev;
      n_bags++;
    }
    a[i] = a[i] - unit_space;
    if (a[i] > 0) {
      n_bags += a[i] / k;
      prev = a[i] % k;
      if (i == n - 1 && prev != 0) {
        n_bags++;
      }
    } else {
      prev = 0;
    }
  }
  cout << n_bags << endl;
  return 0;
}
