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