#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll a[200005];
int main() {
  ios::sync_with_stdio(false);
  ll n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll ans = 0, past = 0;
  for (int i = 0; i < n; i++) {
    if (past != 0) {
      ans++;
      a[i] = max(a[i] - (k - past), 0ll);
      ans += a[i] / k;
      past = a[i] % k;
    } else {
      ans += a[i] / k;
      past = a[i] % k;
    }
  }
  if (past != 0) {
    ans++;
  }
  cout << ans << endl;
}
