#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
void solve() {
  long long n, k, x;
  long long pending = 0;
  long long ans = 0;
  long long buck = 0;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    if (i != n - 1) {
      if (pending == 1) {
        if (x + buck > k) {
          buck += x;
          ans += buck / k;
          buck = buck % k;
          if (buck == 0) pending = 0;
        } else {
          ans++;
          buck = 0;
          pending = 0;
        }
      } else if (pending == 0) {
        if (x % k == 0) {
          ans += x / k;
        } else {
          ans += x / k;
          buck += x % k;
          pending = 1;
        }
      }
    } else {
      buck += x;
      ans += buck / k;
      buck %= k;
      if (buck != 0) ans++;
    }
  }
  cout << ans;
}
signed main() {
  std::ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) solve();
  return 0;
}
