#include <bits/stdc++.h>
using namespace std;
const int LIM = 5e5 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y, h, min = INT_MAX, max = INT_MIN;
int main() {
  cin >> n >> k;
  vector<int> g(n, 0);
  for (int i = 0; i < n; i++) cin >> g[i];
  long int ans = 0;
  for (int i = n - 1; i > 0; i--) {
    if (g[i] == 0) continue;
    x = k - (g[i] % k);
    if (x == k) {
      ans += (g[i] / k);
    } else {
      ans += (g[i] / k) + 1;
      if (x > g[i - 1])
        g[i - 1] = 0;
      else
        g[i - 1] = g[i - 1] - x;
    }
  }
  ans += (g[0] / k) + 1;
  if (g[0] % k == 0) ans--;
  cout << ans << endl;
}
