#include <bits/stdc++.h>
using namespace std;
long long a[1000000];
int main() {
  long long n, k;
  cin >> n >> k;
  memset(a, 0, sizeof a);
  for (int i = 0; i < n; i++) cin >> a[i];
  int temp;
  long long x;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] <= 0) continue;
    temp = ceil((1.0 * a[i]) / (k * 1.0));
    ans += temp;
    x = temp;
    x *= k;
    x -= a[i];
    a[i + 1] -= x;
  }
  cout << ans << endl;
  return 0;
}
