#include <bits/stdc++.h>
using namespace std;
long long n, k, c, s;
long long a[200001];
int32_t main() {
  cin >> n >> k;
  cin >> a[0];
  c = a[0] / k;
  s = a[0] % k;
  for (long long i = 1; i < n; i++) {
    cin >> a[i];
    if (s > 0) c++, a[i] -= (k - s), s = 0;
    a[i] = max(a[i], 0ll);
    c += a[i] / k;
    s = a[i] % k;
  }
  if (s != 0) c++;
  cout << c;
}
