#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int bag = 0, spaceleft = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] > spaceleft) {
      bag += ceil((a[i] - spaceleft) / (k * 1.0));
      spaceleft = k - (a[i] - spaceleft) % k;
      if (spaceleft == k) spaceleft = 0;
    } else {
      spaceleft = 0;
    }
  }
  cout << bag;
}
