#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, inf = 2147483647;
long long n, k, a[N], ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i < n; ++i) {
    long long cnt = a[i] + a[i + 1];
    if (cnt == 0) continue;
    if (cnt < k)
      ans++, a[i + 1] = 0;
    else
      ans += cnt / k, a[i + 1] = cnt % k;
  }
  if (a[n]) ans++;
  cout << ans << endl;
  return 0;
}
