#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int t, m, n, k, q, x, y, z, mx, mn, ans;
  cin >> n >> k;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
  }
  ans = v[0] / k;
  v[0] = v[0] % k;
  for (long long int i = 1; i < n; i++) {
    if (v[i - 1] + v[i] <= k && v[i - 1] + v[i] != 0) {
      ans++;
      v[i] = 0;
    } else {
      ans += (v[i - 1] + v[i]) / k;
      v[i] = (v[i - 1] + v[i]) % k;
    }
  }
  if (v[n - 1]) {
    ans++;
  }
  cout << ans << endl;
}
