#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  long long rem = 0, res = 0;
  bool flag = true;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (flag) {
      res += v[i] / k;
      rem = v[i] % k;
      if (rem != 0) flag = false;
    } else {
      if (rem + v[i] < k) {
        res++;
        rem = 0;
      } else {
        res += (v[i] + rem) / k;
        rem = (v[i] + rem) % k;
      }
      if (rem == 0) flag = true;
    }
  }
  if (rem) res++;
  cout << res << "\n";
  return 0;
}
