#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
const ll N = 2e6 + 12;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll n, k;
  cin >> n >> k;
  vl a(n + 2);
  for (ll i = 1; i <= n; i++) {
    cin >> a[i];
  }
  ll ans = 0;
  for (ll i = 1; i <= n + 1; i++) {
    ans += a[i] / k;
    a[i] %= k;
    if (a[i]) {
      if (a[i] + a[i + 1] <= k) {
        ans += 1;
        a[i + 1] = 0;
      } else {
        a[i + 1] += a[i];
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
