#include <bits/stdc++.h>
using namespace std;
const int mx = 1234567;
const double exp1 = 1e-6;
const int md = 1e9 + 7;
int ar[mx], xar[mx], uses[mx];
long long arr[mx];
string st[1000];
int main() {
  int tk = 1, n, m = 0;
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 0; i < n; i++) {
      scanf("%d", ar + i);
    }
    int l = -1;
    for (int i = n - 1; i >= 0; i--) {
      if (ar[i] > l) {
        l = ar[i];
        xar[i] = l;
      } else {
        xar[i] = l;
      }
    }
    int cnt = 0;
    for (int i = 1; i < n; i++) {
      if (ar[i] > ar[i - 1]) continue;
      int a = ar[i - 1];
      int d = a - ar[i];
      if (d == 0) {
        cnt++;
        ar[i] += m;
      } else {
        int c = d / m;
        cnt += c;
        ar[i] += m * c;
        cnt++;
        ar[i] += m;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
