#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
typedef long long ll;
ll n, k;
ll great_num = 0;
ll yesornot = 0;
vector<ll>a;
ll calculate_min_operations() {
    great_num = 0;
    for (int i = 1; i < n; i++) {
        ll diff = abs(a[i + 1] - a[i]);
        if (diff > k) {
            great_num += ceil((double)diff / k) - 1;
        }
        if (diff == k)yesornot = 1;
    }
    return great_num;
}

void solve() {
    cin >> n >> k;
    a.resize(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    ll ans = calculate_min_operations();
    if (great_num > 0)cout << ans << endl;
    else if (great_num == 0 && yesornot == 1) {
        cout << '0';
    } else {
        cout << '1';
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    solve();
    return 0;
}