#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  long long ans = 0;
  vector<long long> a(n);
  for (int i = 0; i <= (n - 1); ++i) {
    cin >> a[i];
  }
  for (int i = 1; i <= (n - 1); ++i) {
    long long r = a[i - 1] / k + ((a[i - 1] % k == 0) ? 0 : 1);
    long long c = r * k;
    c -= a[i - 1];
    a[i] -= min(a[i], c);
    ans += r;
  }
  ans += a[n - 1] / k + ((a[n - 1] % k == 0) ? 0 : 1);
  cout << ans << endl;
}
int main() {
  clock_t beg = clock();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  clock_t end = clock();
  fprintf(stderr, "%lf\n", (double)(end - beg) / CLOCKS_PER_SEC);
}
