#include <bits/stdc++.h>
using namespace std;
const long long N = (long long)2e5 + 5;
const long long mod = (long long)1e9 + 7;
int main() {
  long long n, k, cur;
  cin >> n >> k >> cur;
  long long res = 0;
  for (long long i = 1, x; i < n; i++) {
    cin >> x;
    long long y = cur % k;
    if (y > 0) y = k - y;
    y = min(y, x);
    cur += y;
    res += (cur + k - 1) / k;
    cur = x - y;
  }
  res += (cur + k - 1) / k;
  cout << res << '\n';
  return 0;
}
