#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const int LIM = 1e5 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int ans = 0, pre = 0;
  for (int i = n - 1; i >= 0; i--) {
    a[i] -= pre;
    if (a[i] < 0) {
      pre = 0;
      continue;
    }
    ans += a[i] / k;
    if (a[i] % k > 0)
      ans++, pre = k - a[i] % k;
    else
      pre = 0;
  }
  cout << ans << "\n";
  return 0;
}
