#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int prevk = 0;
  long long sol = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (prevk) a -= min(a, prevk);
    prevk = a % k;
    sol += a / k + (prevk > 0);
  }
  cout << sol;
}
