#include <bits/stdc++.h>
using namespace std;
int isVowel(char ch) {
  string str = "aeiouAEIOU";
  return (str.find(ch) != string::npos);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) {
    long long int i, j, n, ans = 0, mans = 0, sum = 0;
    string s, str, an = "NO";
    long long int x, y, mx = 0, mn = INT_MAX, z;
    long long int b = 0, k;
    cin >> n >> x;
    vector<int> a(n);
    for (i = 0; i < n; i++) cin >> a[i];
    for (i = 1; i < n; i++) {
      y = 0;
      if (a[i] == a[i - 1]) {
        ans++;
        a[i] += x;
      } else if (a[i] < a[i - 1]) {
        y = (a[i - 1] - a[i] + 1) / x;
        if ((a[i - 1] - a[i] + 1) % x) y++;
        ans += y;
        a[i] += y * x;
      }
    }
    cout << ans << endl;
  }
}
