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