#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, i, rem = 0, bags = 0, p = 1;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    a[i] += rem;
    if (rem != 0) {
      bags++;
      a[i] -= min(k, a[i]);
    }
    bags += (a[i] / k);
    rem = a[i] % k;
  }
  if (rem != 0) bags++;
  cout << bags;
  return 0;
}
