#include <bits/stdc++.h>
using namespace std;
const int N = 1e4;
int a[N];
int b[N];
int main() {
  int n, m;
  long int t = 0;
  int y = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i + 1] <= a[i]) {
      y = (abs(a[i] - a[i + 1]) / m) + 1;
      a[i + 1] += (y * m);
      t += (y);
    }
  }
  cout << t;
}
