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