#include <bits/stdc++.h>
using namespace std;
long long n, m, a[11111], r, k, ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 2; i <= n; i++) {
    if (a[i] == a[i - 1]) {
      ans++;
      a[i] = a[i] + m;
    } else if (a[i] < a[i - 1]) {
      r = abs(a[i] - a[i - 1]);
      k = r / m + 1;
      ans += k;
      a[i] = a[i] + k * m;
    }
  }
  cout << ans << endl;
  return 0;
}
