#include <bits/stdc++.h>
using namespace std;
void solve() {
  int64_t n, k, d = 0;
  cin >> n >> k;
  int64_t arr[n];
  for (int64_t i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int64_t i = 1; i < n; i++) {
    if (arr[i - 1] == arr[i]) {
      arr[i] += k;
      d++;
    } else if (arr[i - 1] > arr[i]) {
      int64_t diff = arr[i - 1] - arr[i];
      int64_t first = diff / k;
      if (first & 1) {
        arr[i] += ((first + 1) * k);
        d = d + (first + 1);
      } else {
        arr[i] += ((first + 1) * k);
        d = d + (first + 1);
      }
    } else {
      continue;
    }
  }
  cout << d << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int64_t test = 1;
  while (test--) {
    solve();
  }
}
