#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<int,int>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e5;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;
ll n , mx , mn = 1e9,cnt , m;
string s;
int main()
{
        TIME;
       cin >> n >> m;
       ll arr[ n ];
       for( int i = 0;i < n;i ++ )
        cin >> arr[i];
        for( int i = 1;i < n;i ++ ){
            if( arr[ i - 1 ] < arr[ i ] )
                continue;
            else
            {
                while( arr[ i - 1 ] >= arr[ i ] ){
                    arr[ i ] += m;
                cnt ++;
                }
            }
        }
        cout << cnt << endl;
        return 0;
}

/* MADE BY
//________________________________________________________
//________________________________________________________ //
                                                           //
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗ //
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║ //
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║ //
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║ //
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║ //
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝ //
//________________________________________________________ //
//________________________________________________________ */


#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<int,int>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e5;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;
ll n , mx , mn = 1e9,cnt , m;
string s;
int main()
{
        TIME;
       cin >> n >> m;
       ll arr[ n ];
       for( int i = 0;i < n;i ++ )
        cin >> arr[i];
        for( int i = 1;i < n;i ++ ){
            if( arr[ i - 1 ] < arr[ i ] )
                continue;
            else
            {
              if( arr[ i - 1 ] == arr[ i ] ){
                arr[i]+=m;
                cnt++;
                continue;
              }
               else{
                   ll ans=arr[ i - 1 ] - arr[ i ];
                    if( max(ans,m)%min(ans,m)==0 )
                arr[i]+=m*(ans/m),cnt+=ans/m;
               else
                arr[i]+=m*(ans/m+1),cnt+=ans/m+1;
                continue;
              }
            }
        }
        cout << cnt << endl;
        return 0;
}

/* MADE BY
//________________________________________________________
//________________________________________________________ //
                                                           //
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗ //
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║ //
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║ //
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║ //
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║ //
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝ //
//________________________________________________________ //
//________________________________________________________ */


#include <bits/stdc++.h>
#define r_0 return 0;
#define ll long long
#define ld  long double
#define pb push_back
#define fr first
#define se second
#define in freopen("input.txt","r",stdin);
#define out freopen("output.txt","w", stdout);
#define TIME ios_base::sync_with_stdio(NULL);
#define tcn cin.tie(NULL);
#define tct cout.tie(NULL);
using namespace std;

const ll N = 1e7 + 7;
ld n , m , cnt , k, ans,mx,a,b;
string s,s1,s2;
vector<string>v,v1;
ll used[N];
ll use[N];
int main(){
   int n;
   cin >> n >> m;
   int arr[n];
   for( int i=0;i < n;i ++ )
    cin >> arr[i];
    arr[n]=arr[n-1];
    sort(arr,arr+n);
    for( int i=0;i < n;i ++ ){
        if( arr[i]==arr[i+1] )
            cnt=0;
        else
            cnt++;
        mx=max(mx,cnt);
    }
    cout<<mx+1;
}


#include <bits/stdc++.h>
#define r_0 return 0;
#define ll long long
#define ld  long double
#define pb push_back
#define fr first
#define se second
#define in freopen("input.txt","r",stdin);
#define out freopen("output.txt","w", stdout);
#define TIME ios_base::sync_with_stdio(NULL);
#define tcn cin.tie(NULL);
#define tct cout.tie(NULL);
using namespace std;
ld n , m , cnt , k, ans,mx,a,b;
string s,s1,s2;
int main(){
   int n;
   cin >> n >> m;
   int arr[n];
   for( int i=0;i < n;i ++ )
    cin >> arr[i];
    arr[n]=arr[n-1];
    sort(arr,arr+n);
    for( int i=0;i < n;i ++ ){
        if( arr[i]==arr[i+1] )
            cnt=0;
        else
            cnt++;
        mx=max(mx,cnt);
    }
    cout<<mx+1;
}
// MADE BY
//________________________________________________________
//________________________________________________________ //
                                                           //
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗ //
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║ //
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║ //
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║ //
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║ //
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝ //
//________________________________________________________ //
//________________________________________________________ //


#include <bits/stdc++.h>
#define r_0 return 0;
#define ll long long
#define ld  long double
#define pb push_back
#define fr first
#define se second
#define in freopen("input.txt","r",stdin);
#define out freopen("output.txt","w", stdout);
#define TIME ios_base::sync_with_stdio(NULL);
#define tcn cin.tie(NULL);
#define tct cout.tie(NULL);
using namespace std;
ld n , m , cnt , k, ans,mx,a,b;
string s,s1,s2;
ll used[N];
ll use[N];
int main(){
   int n;
   cin >> n >> m;
   int arr[n];
   for( int i=0;i < n;i ++ )
    cin >> arr[i];
    arr[n]=arr[n-1];
    sort(arr,arr+n);
    for( int i=0;i < n;i ++ ){
        if( arr[i]==arr[i+1] )
            cnt=0;
        else
            cnt++;
        mx=max(mx,cnt);
    }
    cout<<mx+1;
}
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝


#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<int,int>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e5;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;
ll n , mx , mn = 1e9,cnt , m;
string s;
int main()
{
        TIME;
       cin >> n >> m;
       ll arr[ n ];
       for( int i = 0;i < n;i ++ )
        cin >> arr[i];
        for( int i = 1;i < n;i ++ ){
            if( arr[ i - 1 ] < arr[ i ] )
                continue;
            else
            {
              if( arr[ i - 1 ] == arr[ i ] ){
                arr[i]+=m;
                cnt++;
                continue;
              }
               else{
                   ll ans=arr[i-1]-arr[i]+1;
                   if( ans%m==0 ){
                    arr[i]+=m*(ans/m);
                    cnt+=ans/m;
                   }
                   else{
                    arr[i]+=m*(ans/m+1);
                    cnt+=ans/m+1;
            }
        }
        }
        }
        cout << cnt << endl;
        return 0;
}

/* MADE BY
//________________________________________________________
//________________________________________________________ //
                                                           //
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗ //
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║ //
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║ //
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║ //
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║ //
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝ //
//________________________________________________________ //
//________________________________________________________ */


#include <bits/stdc++.h>
#define r_0 return 0;
#define ll long long
#define ld  long double
#define pb push_back
#define fr first
#define se second
#define in freopen("input.txt","r",stdin);
#define out freopen("output.txt","w", stdout);
#define TIME ios_base::sync_with_stdio(NULL);
#define tcn cin.tie(NULL);
#define tct cout.tie(NULL);
using namespace std;

const ll N = 1e7 + 7;
ll n , m , cnt , k, ans,mx;
string s,s1,s2;
vector<string>v,v1;
int main(){
    while(getline(cin,s) ){
        if( s[0]==char(92) and s[1]=='e' and s[2]=='n' and s[3]=='d' )
            break;
        if( s[0]==char(92) and s[1]=='b' and s[2]=='e' and s[3]=='g' and s[4]=='i' and s[5]=='n' ){
            while( getline(cin,s) ){
              if(  s[1]=='e' and s[2]=='n' and s[3]=='d' )
                break;
              v.pb(s);
            }
        }
        else{
        for( int i=0;i < s.size();i ++ ){e
            if( s[i]=='{' )
                cnt=1;
            if( cnt==1 )
                s1+=s[i];
            if( s[i]=='}' ){
                v1.pb(s1);
                cnt=0;
                s1.clear();
            }
        }
    }
}
int w = 0;
for ( int i = 0; i < v1.size(); i ++ )
{
    k = v[i].find( v1[i] );
    if ( k == 4294967295 )
        ans ++;
}
if ( ans != 0 )
{
    cout<<"Incorrect"<<endl;
    cout<<char(92)<<"begin{thebibliography}{99}"<<endl;
    for( int i=0;i < v1.size();i ++ ){
    for( int j=0;j < v.size();j ++ ){
        k=v[j].find(v1[i]);
if( k!=4294967295 )
    cout<<v[j]<<endl;
    }
}
cout<<char(92)<<"end{thebibliography}"<<char(10);

}
else
    cout<<"Correct";
}


#include <bits/stdc++.h>
#define fr first
#define sc scanf
#define pf printf
#define se second
#define sq(x) x * x
#define ll long long
#define pb push_back
#define mk make_pair
#define ld long double
#define pr pair<int,int>
#define sz(s) int(s.size())
#define piip pair< pair<ll,ll>,ll >
#define fin(s) freopen( s, "r", stdin )
#define fout(s) freopen( s, "w", stdout )
#define TIME ios_base::sync_with_stdio(0)
using namespace std;

const ll INF = 1e9;
const ll N = 1e5;
const ll mod = 1e9 + 7;
const long double eps = 1E-7;
ll n , mx , mn = 1e9,cnt , m;
string s;
int main()
{
        TIME;
       cin >> n >> m;
       ll arr[ n ];
       for( int i = 0;i < n;i ++ )
        cin >> arr[i];
        for( int i = 1;i < n;i ++ ){
            if( arr[ i - 1 ] < arr[ i ] )
                continue;
            else
            {
              if( arr[ i - 1 ] == arr[ i ] ){
                arr[i]+=m;
                cnt++;
                continue;
              }
               else{
                   ll ans=arr[ i - 1 ] - arr[ i ];
                    if( max(ans,m)%min(ans,m)==0 )
                arr[i]+=max(m,m*(ans/m)),cnt+=max(1LL,ans/m);
               else
                arr[i]+=max(m,m*(ans/m+1)),cnt+=max(1LL,ans/m+1);
                continue;
              }
            }
        }
        cout << cnt << endl;
        return 0;
}

/* MADE BY
//________________________________________________________
//________________________________________________________ //
                                                           //
// ██╗   ██╗     ██████╗     ███████╗    ██╗    ███╗   ██╗ //
// ╚██╗ ██╔╝    ██╔═══██╗    ██╔════╝    ██║    ████╗  ██║ //
//  ╚████╔╝     ██║   ██║    ███████╗    ██║    ██╔██╗ ██║ //
//   ╚██╔╝      ██║   ██║    ╚════██║    ██║    ██║╚██╗██║ //
//    ██║       ╚██████╔╝    ███████║    ██║    ██║ ╚████║ //
//    ╚═╝        ╚═════╝     ╚══════╝    ╚═╝    ╚═╝  ╚═══╝ //
//________________________________________________________ //
//________________________________________________________ */


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define ci const int
#define ni ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define cd const double
#define cll const long long
#define ld long double
#define sh short int

using namespace std;

int notzero(int n)
{
	if(n <= 0)
	{
		n = 1;
	}
	return n;
}

int main()
{
	/*
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
    freopen("errors.txt", "w", stderr);
    */
    ni;

    int n, d, b[1000000], ans = 0;
    cin >> n >> d;
    for(int i =0; i < n; i ++)
    {
    	cin >> b[i];
    }

    for(int i =1; i < n; i ++)
    {
    	if(b[i] <= b[i - 1])
    	{
    		int l = b[i - 1] - b[i];

    		if(l == 0)
    		{
    			b[i] += d;
    			ans ++;
    		}

    		else
    		{
    			ans += ceil(l / d) + 1;
    			b[i] += ((l / d) + 1) * d;

    		}
    	}
    }

    cout << ans << '\n';

    //cerr << "\nNo error found\n";
    //cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define ci const int
#define ni ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define cd const double
#define cll const long long
#define ld long double
#define sh short int

using namespace std;

int notzero(int n)
{
	if(n <= 0)
	{
		n = 1;
	}
	return n;
}

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
    freopen("errors.txt", "w", stderr);

    ni;

    int n, d, b[1000000], ans = 0;
    cin >> n >> d;
    for(int i =0; i < n; i ++)
    {
    	cin >> b[i];
    }

    for(int i =1; i < n; i ++)
    {
    	if(b[i] <= b[i - 1])
    	{
    		int l = b[i - 1] - b[i];

    		if(l == 0)
    		{
    			b[i] += d;
    			ans ++;
    		}

    		else
    		{
    			ans += ceil(l / d) + 1;
    			b[i] += ((l / d) + 1) * d;

    		}
    	}
    }

    cout << ans << '\n';

    cerr << "\nNo error found\n";
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define ci const int
#define ni ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define cd const double
#define cll const long long
#define ld long double
#define sh short int

using namespace std;

int notzero(int n)
{
	if(n <= 0)
	{
		n = 1;
	}
	return n;
}

int main()
{
/*
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
    freopen("errors.txt", "w", stderr);
    */
    ni;

    int n, d, b[1000000], ans = 0;
    cin >> n >> d;
    for(int i =0; i < n; i ++)
    {
    	cin >> b[i];
    }

    for(int i =1; i < n; i ++)
    {
    	if(b[i] <= b[i - 1])
    	{
    		int l = b[i - 1] - b[i];

    		if(l == 0)
    		{
    			b[i] += d;
    			ans ++;
    		}

    		else
    		{
    			ans += (l + l - 1) / d;
    			b[i] += ((l + l - 1) / d) * d;
    		}
    	}
    }

    cout << ans << '\n';

  //  cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define ci const int
#define ni ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define cd const double
#define cll const long long
#define ld long double
#define sh short int

using namespace std;

int notzero(int n)
{
	if(n <= 0)
	{
		n = 1;
	}
	return n;
}

int main()
{

	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
    freopen("errors.txt", "w", stderr);
    ni;

    int n, d, b[1000000], ans = 0;
    cin >> n >> d;
    for(int i =0; i < n; i ++)
    {
    	cin >> b[i];
    }

    for(int i =1; i < n; i ++)
    {
    	while(b[i] <= b[i - 1])
    	{
    		b[i] += d;
    		ans ++;
    	}
    }

    cout << ans << '\n';

    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define ci const int
#define ni ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define cd const double
#define cll const long long
#define ld long double
#define sh short int

using namespace std;

int notzero(int n)
{
	if(n <= 0)
	{
		n = 1;
	}
	return n;
}

int main()
{
/*
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
    freopen("errors.txt", "w", stderr);
    ni;
*/
    int n, d, b[1000000], ans = 0;
    cin >> n >> d;
    for(int i =0; i < n; i ++)
    {
    	cin >> b[i];
    }

    for(int i =1; i < n; i ++)
    {
    	while(b[i] <= b[i - 1])
    	{
    		b[i] += d;
    		ans ++;
    	}
    }

    cout << ans << '\n';

  //  cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	return 0;
}


#include<bits/stdc++.h>
#define pb push_back
#define bp pop_back
#define all(v) (v).begin(),(v).end()
#define foru(i, a, b) for (ll i = a; i<(ll)b; i++)
#define ford(i, a, b) for (ll i = a; i>=(ll)b; i--)
#define fore(i, a, b) for (ll i = a; i<=(ll)b; i++)
#define forp(i,a,b,c) for(ll i=(ll)a;i<(ll)b;i+=(ll)c)
#define fi first
#define se second
#define open  freopen("input.txt","r",stdin)
#define close  freopen ("output.txt","w",stdout)
#define db double
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define min3(a,b,c)         min(a,min(b,c))
#define max3(a,b,c)         max(a,max(b,c))
#define min4(a,b,c,d)       min(min(a,b),min(c,d))
#define max4(a,b,c,d)       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)     min(min3(a,b,c),min(d,e))
#define dist(x1, y1, x2, y2) sqrt(sq(x1-x2)+sq(y1-y2))
using namespace std;
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll ;
typedef unsigned long long ull ;
typedef long double ld;
const double PI = 3.1415926535897932 ;
const ll INF=1e18;
ll gcd(ll x, ll y) { return (y == 0 ? x : gcd(y, x % y)); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
bool isprime(ll u){for(ll i=2;i<=(int)sqrt(u);i++){if(u%i==0)return 0;}return 1;}

//237A
int main()
{
ll n, d, x, nb = 0, prev,i,b;
cin >> n >> d >> prev;

foru(i,0,n-1)
{
	cin >> x;
	if(x <= prev)
	{
		b=(prev - x)/d + 1;
		x+=b*d;
		nb += b;
	}
	prev = x;
}

cout << nb;
 return 0;

}


#include<bits/stdc++.h>
#define pb push_back
#define bp pop_back
#define all(v) (v).begin(),(v).end()
#define foru(i, a, b) for (ll i = a; i<(ll)b; i++)
#define ford(i, a, b) for (ll i = a; i>=(ll)b; i--)
#define fore(i, a, b) for (ll i = a; i<=(ll)b; i++)
#define forp(i,a,b,c) for(ll i=(ll)a;i<(ll)b;i+=(ll)c)
#define fi first
#define se second
#define open  freopen("input.txt","r",stdin)
#define close  freopen ("output.txt","w",stdout)
#define db double
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define min3(a,b,c)         min(a,min(b,c))
#define max3(a,b,c)         max(a,max(b,c))
#define min4(a,b,c,d)       min(min(a,b),min(c,d))
#define max4(a,b,c,d)       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)     min(min3(a,b,c),min(d,e))
#define dist(x1, y1, x2, y2) sqrt(sq(x1-x2)+sq(y1-y2))
using namespace std;
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll ;
typedef unsigned long long ull ;
typedef long double ld;
const double PI = 3.1415926535897932 ;
const ll INF=1e18;
ll gcd(ll x, ll y) { return (y == 0 ? x : gcd(y, x % y)); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
bool isprime(ll u){for(ll i=2;i<=(int)sqrt(u);i++){if(u%i==0)return 0;}return 1;}

//237A
int main()
{
ll n, d, x, nb, prev,i;
cin >> n >> d >> prev;

foru(i,0,n-1)
{
	cin >> x;
	if(x <= prev)
	{
		b=(prev - x)/d + 1;
		x+=b*d;
		nb += b;
	}
	prev = x;
}

cout << nb;
 return 0;

}


#include<bits/stdc++.h>
#define pb push_back
#define bp pop_back
#define all(v) (v).begin(),(v).end()
#define foru(i, a, b) for (ll i = a; i<(ll)b; i++)
#define ford(i, a, b) for (ll i = a; i>=(ll)b; i--)
#define fore(i, a, b) for (ll i = a; i<=(ll)b; i++)
#define forp(i,a,b,c) for(ll i=(ll)a;i<(ll)b;i+=(ll)c)
#define fi first
#define se second
#define open  freopen("input.txt","r",stdin)
#define close  freopen ("output.txt","w",stdout)
#define db double
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define min3(a,b,c)         min(a,min(b,c))
#define max3(a,b,c)         max(a,max(b,c))
#define min4(a,b,c,d)       min(min(a,b),min(c,d))
#define max4(a,b,c,d)       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)     min(min3(a,b,c),min(d,e))
#define dist(x1, y1, x2, y2) sqrt(sq(x1-x2)+sq(y1-y2))
using namespace std;
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll ;
typedef unsigned long long ull ;
typedef long double ld;
const double PI = 3.1415926535897932 ;
const ll INF=1e18;
ll gcd(ll x, ll y) { return (y == 0 ? x : gcd(y, x % y)); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
bool isprime(ll u){for(ll i=2;i<=(int)sqrt(u);i++){if(u%i==0)return 0;}return 1;}

int main()
{
ll n,d,i,nb = 0;
cin >> n >> d;
ll t[n+1];
foru(i, 0, n)
{
	cin >> t[i];
	if(i != 0)
	{
	while(t[i] <= t[i-1])
	{
		t[i] += d;
		nb++;
	}
	}
}
cout << nb;

 return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define foru(i, a, b) for (ll i = a; i<(ll)b; i++)
typedef long long ll ;

int main()
{
ll n,d,i,nb = 0;
cin >> n >> d;
ll t[n+1];
foru(i, 0, n)
{
	cin >> t[i];
	if(i != 0)
	{
	while(t[i] <= t[i-1])
	{
		t[i] += d;
		nb++;
	}
	}
}
cout << nb;

 return 0;

}


#include<bits/stdc++.h>
#define pb push_back
#define bp pop_back
#define all(v) (v).begin(),(v).end()
#define foru(i, a, b) for (ll i = a; i<(ll)b; i++)
#define ford(i, a, b) for (ll i = a; i>=(ll)b; i--)
#define fore(i, a, b) for (ll i = a; i<=(ll)b; i++)
#define forp(i,a,b,c) for(ll i=(ll)a;i<(ll)b;i+=(ll)c)
#define fi first
#define se second
#define open  freopen("input.txt","r",stdin)
#define close  freopen ("output.txt","w",stdout)
#define db double
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define min3(a,b,c)         min(a,min(b,c))
#define max3(a,b,c)         max(a,max(b,c))
#define min4(a,b,c,d)       min(min(a,b),min(c,d))
#define max4(a,b,c,d)       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)     min(min3(a,b,c),min(d,e))
#define dist(x1, y1, x2, y2) sqrt(sq(x1-x2)+sq(y1-y2))
using namespace std;
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll ;
typedef unsigned long long ull ;
typedef long double ld;
const double PI = 3.1415926535897932 ;
const ll INF=1e18;
ll gcd(ll x, ll y) { return (y == 0 ? x : gcd(y, x % y)); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
bool isprime(ll u){for(ll i=2;i<=(int)sqrt(u);i++){if(u%i==0)return 0;}return 1;}

//237A
int main()
{
ll n, d, x, nb = 0, prev,i,b;
cin >> n >> d >> prev;

foru(i,0,n-1)
{
	cin >> x;
	if(x <= prev)
	{
		b=(prev - x)/d + 1;
		x+=b;
		nb += b;
	}
	prev = x;
}

cout << nb;
 return 0;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
int n,d,i,nb = 0;
int t[2000];
cin>>n>>d;

for(i = 0 ;i<n;i++)
{
	cin>>t[i];
}

for(i = 1;i<n;i++)
{
	while(t[i]<=t[i-1])
	{
		t[i]+=d;
		nb++;
	}
}
cout<<nb;

 return 0;

}


#include<bits/stdc++.h>
#define pb push_back
#define bp pop_back
#define all(v) (v).begin(),(v).end()
#define foru(i, a, b) for (ll i = a; i<(ll)b; i++)
#define ford(i, a, b) for (ll i = a; i>=(ll)b; i--)
#define fore(i, a, b) for (ll i = a; i<=(ll)b; i++)
#define forp(i,a,b,c) for(ll i=(ll)a;i<(ll)b;i+=(ll)c)
#define fi first
#define se second
#define open  freopen("input.txt","r",stdin)
#define close  freopen ("output.txt","w",stdout)
#define db double
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define min3(a,b,c)         min(a,min(b,c))
#define max3(a,b,c)         max(a,max(b,c))
#define min4(a,b,c,d)       min(min(a,b),min(c,d))
#define max4(a,b,c,d)       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)     min(min3(a,b,c),min(d,e))
#define dist(x1, y1, x2, y2) sqrt(sq(x1-x2)+sq(y1-y2))
using namespace std;
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll ;
typedef unsigned long long ull ;
typedef long double ld;
const double PI = 3.1415926535897932 ;
const ll INF=1e18;
ll gcd(ll x, ll y) { return (y == 0 ? x : gcd(y, x % y)); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
bool isprime(ll u){for(ll i=2;i<=(int)sqrt(u);i++){if(u%i==0)return 0;}return 1;}

int main()
{
int n,d,i,nb = 0;
cin >> n >> d;
int t[n+1];
foru(i, 0, n)
{
	cin >> t[i];
	if(i != 0)
	{
	while(t[i] <= t[i-1])
	{
		t[i] += d;
		nb++;
	}
	}
}
cout << nb;

 return 0;

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 29 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;

//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    // seive();
    int t=1;
    // cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>n>>k;
        int arr[n+4];
        for(i=0; i<n; i++)
        {
            cin>>arr[i];
        }

        for(i=0; i<n-1; i++)
        {
            if(arr[i]<arr[i+1])
            {
                continue;
            }
            else if(arr[i]==arr[i+1])
            {
                arr[i+1]+=k;
                ans++;
            }
            else
            {
                x=arr[i]-arr[i+1];
                x++;
                cnt=x/k;
                if(x%k)
                {
                    cnt++;
                }
                arr[i+1]+=(cnt*k);
                ans+=cnt;
            }
        }

        cout<<ans<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 29 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;

//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    // seive();
    int t=1;
    // cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>n>>k;
        int arr[n+4];
        for(i=0; i<n; i++)
        {
            cin>>arr[i];
        }

        for(i=0; i<n-1; i++)
        {
            if(arr[i]<arr[i+1])
            {
                continue;
            }
            else if(arr[i]==arr[i+1])
            {
                arr[i+1]+=k;
                ans++;
            }
            else
            {
                x=arr[i]-arr[i+1];
                cnt=x/k;
                if(x%k)
                {
                    cnt++;
                }
                ans+=cnt;
            }
        }

        cout<<ans<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 29 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;

//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    // seive();
    int t=1;
    // cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>n>>k;
        int arr[n+4];
        for(i=0; i<n; i++)
        {
            cin>>arr[i];
        }

        for(i=0; i<n-1; i++)
        {
            if(arr[i]<arr[i+1])
            {
                continue;
            }
            else if(arr[i]==arr[i+1])
            {
                arr[i+1]+=k;
                ans++;
            }
            else
            {
                x=arr[i]-arr[i+1];
                cnt=x/k;
                if(x%k)
                {
                    cnt++;
                }
                arr[i+1]+=(cnt*k);
                ans+=cnt;
            }
        }

        cout<<ans<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


///***###                               بسم الله الرحمن الرحيم                            ###***///

/*
                    Author          : Borhan Uddin Rafi
                    University      : Begum Rokeya University,Rangpur.
                    Date            : 29 Oct,2020;
*/

///************************Start Of Template*************************///

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#define Read_Fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define all(a) a.begin(),a.end()
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<n;i++)
#define f1n(i,n) for(i=1;i<=n;i++)
#define szf sizeof()
#define sz size()
#define ln length()
#define mem(x,r) memset(x,r,sizeof(x))
#define inf 1000000000000
using namespace std;
using ll=long long;
const int N=1e1+4;

//////graph////////

vector<int>circle;
bool vis[N];
int parent[N];
ll chk[N];
int color[N];
int tim[N];
int dis[N];
int position[N];
vector<int>adj[N];
vector<int>adj1[N];
vector<int>graph[N];
bool has_cycle;
int maxdis,maxnode,Totnode,depth=1;
bool ok;
queue<int>q;
stack<int>stk;
vector<int>solution;
int indegree[N];
int go[N];
int to[N];
ll x1,x2,x3,x4,x5,x6;
string ss;
int gn,gk;

//////graph////////

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //Read_Fast;
    // seive();
    int t=1;
    // cin>>t;
    int cas=0;
    while(t--)
    {
        ll n,m,i,j,cnt=0,cnt1=0,cnt2=0,even=0,odd=0,len,k,r,l,z=0,x=0,y=0,flag=0,sum=0;
        ll a=0,b=0,c=0,d=0,ans=0,rem,quot,zero=0,fst=0,null=0,snd=0,lst=0,rone=0,one=0,pos=0,neg=0,mn=INT_MAX,mx=INT_MIN;

        char ch;

        ////Time/////
        int h1,h2,m1,m2,h;

        ////motion ////
        int velo1,velo2,ac1,ac2,tim,hour,mint,sec;

        /////Graph///
        int node,edge,u,v,cost;
        int bst,wrst;
        double nd,ad,bd,xd,sumd=0.00;
        string str,str1="",str2="",str3="",strstore1="",strstore2="";

        //////Input Node //////

        cin>>n>>k;
        int arr[n+4];
        for(i=0; i<n; i++)
        {
            cin>>arr[i];
        }

        for(i=0; i<n-1; i++)
        {
            if(arr[i]<arr[i+1])
            {
                continue;
            }
            else
            {
                x=arr[i]-arr[i+1];
                cnt=x/k;
                if(x%k)
                {
                    cnt++;
                }
                ans+=cnt;
            }
        }

        cout<<cnt<<endl;

    }
    return 0;
//////***###            ٱلْحَمْدُ لِلَّٰهِ          ###***//////

}


#include<bits/stdc++.h>
using namespace std;
int a[1052], n, d, rs;
int main()
{
    cin >> n >> d;
    for(int i = 1; i <= n; i++)
						cin>>a[i];
    for(int i = 2; i <= n; i++)
			if(a[i] <= a[i - 1])
    							{
       							int tmp = (a[i - 1] - a[i] + d)/d;
       						 	a[i] += tmp * d;
        					 	rs += tmp;
   								 }
    cout<<rs;
}


#include<bits/stdc++.h>
using namespace std;
int a[2002], n, d, rs;
int main()
{
    cin >> n >> d;
    for(int i = 1; i <= n; i++)
						cin>>a[i];
    for(int i = 2; i <= n; i++)
			if(a[i] <= a[i - 1])
    							{
       							int tmp = (a[i - 1] - a[i] + d)/d;
       						 	a[i] += tmp * d;
        					 	rs += tmp;
   								 }
    cout<<rs;
}


#include<bits/stdc++.h>
using namespace std;
int a[2002], n, d, rs;
int main()
{
    cin >> n >> d;
    for(int i = 1; i <= n; i++)
						cin>>a[i];
    for(int i = 2; i <= n; i++)
			if(a[i] <= a[i - 1])
    							{
       							int tmp = (a[i - 1] - a[i] + d)/d;
       						 	a[i] += tmp * d;
        					 	rss += tmp;
   								 }
    cout<<rs;
}


#include<bits/stdc++.h>
using namespace std;
int a[1002], n, d, rs;
int main()
{
    cin >> n >> d;
    for(int i = 1; i <= n; i++)
						cin>>a[i];
    for(int i = 2; i <= n; i++)
			if(a[i] <= a[i - 1])
    							{
       							int tmp = (a[i - 1] - a[i] + d)/d;
       						 	a[i] += tmp * d;
        					 	rs += tmp;
   								 }
    cout<<rs;
}


#include<bits/stdc++.h>

#define pb push_back
#define ffor(l,r) for(int i=l;i<r;i++)
#define dfor(l,r) for(int i=l;i>=r;i--)
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define ll long long
#define modulo 1e9+7
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define printA(arr,e) ffor(0,e) cout<<arr[i]<<" "
#define printC(container) for(auto it : container) cout<<it<<" "
#define desc(type) greater<type>()
// #define pre(n) setprecision(n)
using namespace std;
void setMyPrecision(int n)
{
    cout << fixed << setprecision(n);
}

bool test = 0;
void solve() {
    int n;
    double d;
    cin>>n>>d;
    int arr[n];
    for(int i=0;i<n;i++) cin>>arr[i];
    ll ans = 0;
    for(int i=1;i<n;i++){
        if(arr[i]<arr[i-1]){
            int rem = ceil((arr[i-1]-arr[i])/d);
            arr[i] += d*rem;
            ans += rem;
        }
        if(arr[i]==arr[i-1]){
            ans++;
            arr[i]+=d;
        }
    }
    cout<<ans;
    // for(int i=1;i<n;i++){
    //     float tmp;
    //     cin>>tmp;
    //     // cout<<last<<" "<<ans<<endl;
    //     if(tmp<=last){

    //         if(last==tmp){
    //             ans++;
    //             tmp+=d;
    //         }
    //         else{
    //             int rem= ceil((last-tmp)/d);
    //             tmp += d*rem;
    //             ans += rem;
    //             if(last==tmp){
    //                 ans++;
    //                 tmp+=d;
    //             }
    //         }

    //     }
    //     last = tmp;
    // }
    // cout<<ans;
}

int main() {
    ios::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    if (test) {
        int t;
        cin>>t;
        while (t--)
            solve();
    }
    else
        solve();

    return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ffor(l,r) for(int i=l;i<r;i++)
#define dfor(l,r) for(int i=l;i>=r;i--)
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define ll long long
#define modulo 1e9+7
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define printA(arr,e) ffor(0,e) cout<<arr[i]<<" "
#define printC(container) for(auto it : container) cout<<it<<" "
#define desc(type) greater<type>()
// #define pre(n) setprecision(n)
using namespace std;
void setMyPrecision(int n)
{
    cout << fixed << setprecision(n);
}

bool test = 0;
void solve() {
    float n,d;
    cin>>n>>d;
    float last;
    cin>>last;
    ll ans = 0;
    for(int i=1;i<n;i++){
        float tmp;
        cin>>tmp;
        if(tmp<=last){
            if(last==tmp){
                ans++;
                tmp+=d;
            }
            else{
                int rem= ceil((last-tmp)/d);
                tmp += d*rem;
                ans += rem;
            }

        }
        last = tmp;
    }
    cout<<ans;
}

int main() {
    ios::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    if (test) {
        int t;
        cin>>t;
        while (t--)
            solve();
    }
    else
        solve();

    return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ffor(l,r) for(int i=l;i<r;i++)
#define dfor(l,r) for(int i=l;i>=r;i--)
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define ll long long
#define modulo 1e9+7
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define printA(arr,e) ffor(0,e) cout<<arr[i]<<" "
#define printC(container) for(auto it : container) cout<<it<<" "
#define desc(type) greater<type>()
// #define pre(n) setprecision(n)
using namespace std;
void setMyPrecision(int n)
{
    cout << fixed << setprecision(n);
}

bool test = 0;
void solve() {
    float n,d;
    cin>>n>>d;
    float last;
    cin>>last;
    ll ans = 0;
    for(int i=1;i<n;i++){
        float tmp;
        cin>>tmp;
        if(tmp<=last){
            if(last==tmp){
                ans++;
                tmp+=d;
            }
            else{
                int rem= ceil((last-tmp)/d);
                tmp += d*rem;
                ans += rem;
                if(last==tmp){
                    ans++;
                    tmp+=d;
                }
            }

        }
        last = tmp;
    }
    cout<<ans;
}

int main() {
    ios::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    if (test) {
        int t;
        cin>>t;
        while (t--)
            solve();
    }
    else
        solve();

    return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ffor(l,r) for(int i=l;i<r;i++)
#define dfor(l,r) for(int i=l;i>=r;i--)
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define ll long long
#define modulo 1e9+7
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define printA(arr,e) ffor(0,e) cout<<arr[i]<<" "
#define printC(container) for(auto it : container) cout<<it<<" "
#define desc(type) greater<type>()
// #define pre(n) setprecision(n)
using namespace std;
void setMyPrecision(int n)
{
    cout << fixed << setprecision(n);
}

bool test = 0;
void solve() {
    float n,d;
    cin>>n>>d;
    float last;
    cin>>last;
    int ans = 0;
    for(int i=1;i<n;i++){
        float tmp;
        cin>>tmp;
        if(tmp<=last){
            if(last==tmp){
                ans++;
                tmp+=d;
            }
            else{
                int rem= ceil((last-tmp)/d);
                tmp += d*rem;
                ans += rem;
            }

        }
        last = tmp;
    }
    cout<<ans;
}

int main() {
    ios::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    if (test) {
        int t;
        cin>>t;
        while (t--)
            solve();
    }
    else
        solve();

    return 0;
}


/*************************************************\
           In the name of almighty ALLAH
                 MD.Faysal Hasan
                Comilla Univesity
\*************************************************/

#include<bits/stdc++.h>
using namespace std;

#define     ikarus_101  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef     long long             ll;
typedef     long double           ld;
typedef     unsigned long long    ull;
typedef     vector<ll>            vll;
typedef     pair<ll,ll>           pll;
typedef     vector<pll>           vpl;
typedef     map<ll,ll>            mll;
typedef     multiset<ll>          msl;
typedef     multimap<ll,ll>       Mll;
using pqboro=priority_queue<ll,vll,less<ll>>;
using pqchoto=priority_queue<ll,vll,greater<ll>>;

#define    all(str)       str.begin(),str.end()
#define    sajo(str)      sort(str.begin(),str.end())
#define    rev(str)       reverse(str.begin(),str.end())
#define    usajo(str)     sort(str.rbegin(),str.rend())
#define    vin(a)         for(auto &it : a) cin>>it
#define    vout(a)        for(auto it:a) cout<<it<<' ';cout<<nn
#define    vmax(a)        *max_element(all(a))
#define    vmin(a)        *min_element(all(a))
#define    pb             push_back
#define    eb             emplace_back
#define    mkp(x,y)       make_pair(x,y)
#define    F              first
#define    S              second
#define    yes            cout<<"Yes"<<nn
#define    no             cout<<"No"<<nn
#define    nn             "\n" ///endl
#define    rep(i,n)       for (i=0;i<n;++i )
#define    rep1(i,n)      for (i=1;i<=n;++i )

#define    min3(a,b,c)    min(a,min(b,c))
#define    max3(a,b,c)    max(a,max(b,c))
#define    sqr(x)         ((x)*(x))
#define    pi             2*acos(0.0)
#define    gcd(a,b)       __gcd(a,b)
#define    lcm(a,b)       (a/gcd(a,b))*b
#define    mem(a,b)       memset(a,b,sizeof (a))
#define    dec(x)         cout<<fixed<<setprecision(x)
#define    none(n)         __builtin_popcountll(n)

template < typename T > string toString ( T Number ) { stringstream ss ; ss << Number ; return ss.str() ; }
template < typename T > ll toll ( T str ) { stringstream ss ; ss << str ; ll num ; ss >> num ; return num ; }

const   int  N   =   2e5+7;
const   int  M   =   1e9+7;
const   ll  inf  =   0x7f7f7f7f7f7f7f7f;
const   int dx[] =   {+1,+2,+2,+1,-1,-2,-2,-1};
const   int dy[] =   {-2,-1,+1,+2,+2,+1,-1,-2};

int main() {ikarus_101

    ll  n , m , i , j , k , x ;

    cin >> n >> k ;
    vll v(n);
    vin(v);
    ll cnt = 0 ;
    for(i=0;i<(n-1);i++)
    {
        if(v[i] > v[i+1])
        {
            ll dif = v[i] - v[i+1] ;
            ll t = (dif+k)/k;
            cnt += t;
            v[i+1] = v[i+1] + (k*t);
        }
        else if(v[i] == v[i+1])
        {
            ++cnt;
            v[i+1] = v[i+1]+k ;
        }
    }
    cout << cnt << endl;

    return 0;
}


/*************************************************\
           In the name of almighty ALLAH
                 MD.Faysal Hasan
                Comilla Univesity
\*************************************************/

#include<bits/stdc++.h>
using namespace std;

#define     ikarus_101  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef     long long             ll;
typedef     long double           ld;
typedef     unsigned long long    ull;
typedef     vector<ll>            vll;
typedef     pair<ll,ll>           pll;
typedef     vector<pll>           vpl;
typedef     map<ll,ll>            mll;
typedef     multiset<ll>          msl;
typedef     multimap<ll,ll>       Mll;
using pqboro=priority_queue<ll,vll,less<ll>>;
using pqchoto=priority_queue<ll,vll,greater<ll>>;

#define    all(str)       str.begin(),str.end()
#define    sajo(str)      sort(str.begin(),str.end())
#define    rev(str)       reverse(str.begin(),str.end())
#define    usajo(str)     sort(str.rbegin(),str.rend())
#define    vin(a)         for(auto &it : a) cin>>it
#define    vout(a)        for(auto it:a) cout<<it<<' ';cout<<nn
#define    vmax(a)        *max_element(all(a))
#define    vmin(a)        *min_element(all(a))
#define    pb             push_back
#define    eb             emplace_back
#define    mkp(x,y)       make_pair(x,y)
#define    F              first
#define    S              second
#define    yes            cout<<"Yes"<<nn
#define    no             cout<<"No"<<nn
#define    nn             "\n" ///endl
#define    rep(i,n)       for (i=0;i<n;++i )
#define    rep1(i,n)      for (i=1;i<=n;++i )

#define    min3(a,b,c)    min(a,min(b,c))
#define    max3(a,b,c)    max(a,max(b,c))
#define    sqr(x)         ((x)*(x))
#define    pi             2*acos(0.0)
#define    gcd(a,b)       __gcd(a,b)
#define    lcm(a,b)       (a/gcd(a,b))*b
#define    mem(a,b)       memset(a,b,sizeof (a))
#define    dec(x)         cout<<fixed<<setprecision(x)
#define    none(n)         __builtin_popcountll(n)

template < typename T > string toString ( T Number ) { stringstream ss ; ss << Number ; return ss.str() ; }
template < typename T > ll toll ( T str ) { stringstream ss ; ss << str ; ll num ; ss >> num ; return num ; }

const   int  N   =   2e5+7;
const   int  M   =   1e9+7;
const   ll  inf  =   0x7f7f7f7f7f7f7f7f;
const   int dx[] =   {+1,+2,+2,+1,-1,-2,-2,-1};
const   int dy[] =   {-2,-1,+1,+2,+2,+1,-1,-2};

int main() {ikarus_101

    ll  n , m , i , j , k , x ;

    cin >> n >> k ;
    vll v(n);
    vin(v);
    ll cnt = 0 ;
    for(i=0;i<(n-1);i++)
    {
        if(v[i] > v[i+1])
        {
            dif = v[i] - v[i+1] ;
            ll t = (dif+k-1)/k;
            cnt += t;
            v[i+1] = v[i+1] + (k*t);
        }
        else if(v[i] == v[i+1])
        {
            ++cnt;
            v[i+1] = v[i+1]+k ;
        }
    }
    cout << cnt << endl;

    return 0;
}


/*************************************************\
           In the name of almighty ALLAH
                 MD.Faysal Hasan
                Comilla Univesity
\*************************************************/

#include<bits/stdc++.h>
using namespace std;

#define     ikarus_101  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef     long long             ll;
typedef     long double           ld;
typedef     unsigned long long    ull;
typedef     vector<ll>            vll;
typedef     pair<ll,ll>           pll;
typedef     vector<pll>           vpl;
typedef     map<ll,ll>            mll;
typedef     multiset<ll>          msl;
typedef     multimap<ll,ll>       Mll;
using pqboro=priority_queue<ll,vll,less<ll>>;
using pqchoto=priority_queue<ll,vll,greater<ll>>;

#define    all(str)       str.begin(),str.end()
#define    sajo(str)      sort(str.begin(),str.end())
#define    rev(str)       reverse(str.begin(),str.end())
#define    usajo(str)     sort(str.rbegin(),str.rend())
#define    vin(a)         for(auto &it : a) cin>>it
#define    vout(a)        for(auto it:a) cout<<it<<' ';cout<<nn
#define    vmax(a)        *max_element(all(a))
#define    vmin(a)        *min_element(all(a))
#define    pb             push_back
#define    eb             emplace_back
#define    mkp(x,y)       make_pair(x,y)
#define    F              first
#define    S              second
#define    yes            cout<<"Yes"<<nn
#define    no             cout<<"No"<<nn
#define    nn             "\n" ///endl
#define    rep(i,n)       for (i=0;i<n;++i )
#define    rep1(i,n)      for (i=1;i<=n;++i )

#define    min3(a,b,c)    min(a,min(b,c))
#define    max3(a,b,c)    max(a,max(b,c))
#define    sqr(x)         ((x)*(x))
#define    pi             2*acos(0.0)
#define    gcd(a,b)       __gcd(a,b)
#define    lcm(a,b)       (a/gcd(a,b))*b
#define    mem(a,b)       memset(a,b,sizeof (a))
#define    dec(x)         cout<<fixed<<setprecision(x)
#define    none(n)         __builtin_popcountll(n)

template < typename T > string toString ( T Number ) { stringstream ss ; ss << Number ; return ss.str() ; }
template < typename T > ll toll ( T str ) { stringstream ss ; ss << str ; ll num ; ss >> num ; return num ; }

const   int  N   =   2e5+7;
const   int  M   =   1e9+7;
const   ll  inf  =   0x7f7f7f7f7f7f7f7f;
const   int dx[] =   {+1,+2,+2,+1,-1,-2,-2,-1};
const   int dy[] =   {-2,-1,+1,+2,+2,+1,-1,-2};

int main() {ikarus_101

    ll  n , m , i , j , k , x ;

    cin >> n >> k;
    ll a[n+1];
    for(i=0;i<n;i++)
        scanf("%lld",a+i);
    ll cnt = 0 ;
    for(i=1;i<n;i++)
    {
        if(a[i] < a[i-1])
        {
            ll dif = a[i-1]-a[i];
            ll lagbe = (dif + k -1) / k ;
            a[i] += lagbe * k ;
            cnt += lagbe ;
        }
        else if(a[i]==a[i-1]) {
            a[i] += k ;
            ++cnt;
        }
    }
    cout << cnt << endl;

    return 0;
}


/*************************************************\
           In the name of almighty ALLAH
                 MD.Faysal Hasan
                Comilla Univesity
\*************************************************/

#include<bits/stdc++.h>
using namespace std;

#define     ikarus_101  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef     long long             ll;
typedef     long double           ld;
typedef     unsigned long long    ull;
typedef     vector<ll>            vll;
typedef     pair<ll,ll>           pll;
typedef     vector<pll>           vpl;
typedef     map<ll,ll>            mll;
typedef     multiset<ll>          msl;
typedef     multimap<ll,ll>       Mll;
using pqboro=priority_queue<ll,vll,less<ll>>;
using pqchoto=priority_queue<ll,vll,greater<ll>>;

#define    all(str)       str.begin(),str.end()
#define    sajo(str)      sort(str.begin(),str.end())
#define    rev(str)       reverse(str.begin(),str.end())
#define    usajo(str)     sort(str.rbegin(),str.rend())
#define    vin(a)         for(auto &it : a) cin>>it
#define    vout(a)        for(auto it:a) cout<<it<<' ';cout<<nn
#define    vmax(a)        *max_element(all(a))
#define    vmin(a)        *min_element(all(a))
#define    pb             push_back
#define    eb             emplace_back
#define    mkp(x,y)       make_pair(x,y)
#define    F              first
#define    S              second
#define    yes            cout<<"Yes"<<nn
#define    no             cout<<"No"<<nn
#define    nn             "\n" ///endl
#define    rep(i,n)       for (i=0;i<n;++i )
#define    rep1(i,n)      for (i=1;i<=n;++i )

#define    min3(a,b,c)    min(a,min(b,c))
#define    max3(a,b,c)    max(a,max(b,c))
#define    sqr(x)         ((x)*(x))
#define    pi             2*acos(0.0)
#define    gcd(a,b)       __gcd(a,b)
#define    lcm(a,b)       (a/gcd(a,b))*b
#define    mem(a,b)       memset(a,b,sizeof (a))
#define    dec(x)         cout<<fixed<<setprecision(x)
#define    none(n)         __builtin_popcountll(n)

template < typename T > string toString ( T Number ) { stringstream ss ; ss << Number ; return ss.str() ; }
template < typename T > ll toll ( T str ) { stringstream ss ; ss << str ; ll num ; ss >> num ; return num ; }

const   int  N   =   2e5+7;
const   int  M   =   1e9+7;
const   ll  inf  =   0x7f7f7f7f7f7f7f7f;
const   int dx[] =   {+1,+2,+2,+1,-1,-2,-2,-1};
const   int dy[] =   {-2,-1,+1,+2,+2,+1,-1,-2};

int main() {ikarus_101

    ll  n , m , i , j , k , x ;

    cin >> n >> k ;
    vll v(n);
    vin(v);
    ll cnt = 0 ;
    for(i=0;i<(n-1);i++)
    {
        if(v[i] > v[i+1])
        {
            ll dif = v[i] - v[i+1] ;
            ll t = (dif+k-1)/k;
            cnt += t;
            v[i+1] = v[i+1] + (k*t);
        }
        else if(v[i] == v[i+1])
        {
            ++cnt;
            v[i+1] = v[i+1]+k ;
        }
    }
    cout << cnt << endl;

    return 0;
}


/*************************************************\
           In the name of almighty ALLAH
                 MD.Faysal Hasan
                Comilla Univesity
\*************************************************/

#include<bits/stdc++.h>
using namespace std;

#define     ikarus_101  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef     long long             ll;
typedef     long double           ld;
typedef     unsigned long long    ull;
typedef     vector<ll>            vll;
typedef     pair<ll,ll>           pll;
typedef     vector<pll>           vpl;
typedef     map<ll,ll>            mll;
typedef     multiset<ll>          msl;
typedef     multimap<ll,ll>       Mll;
using pqboro=priority_queue<ll,vll,less<ll>>;
using pqchoto=priority_queue<ll,vll,greater<ll>>;

#define    all(str)       str.begin(),str.end()
#define    sajo(str)      sort(str.begin(),str.end())
#define    rev(str)       reverse(str.begin(),str.end())
#define    usajo(str)     sort(str.rbegin(),str.rend())
#define    vin(a)         for(auto &it : a) cin>>it
#define    vout(a)        for(auto it:a) cout<<it<<' ';cout<<nn
#define    vmax(a)        *max_element(all(a))
#define    vmin(a)        *min_element(all(a))
#define    pb             push_back
#define    eb             emplace_back
#define    mkp(x,y)       make_pair(x,y)
#define    F              first
#define    S              second
#define    yes            cout<<"Yes"<<nn
#define    no             cout<<"No"<<nn
#define    nn             "\n" ///endl
#define    rep(i,n)       for (i=0;i<n;++i )
#define    rep1(i,n)      for (i=1;i<=n;++i )

#define    min3(a,b,c)    min(a,min(b,c))
#define    max3(a,b,c)    max(a,max(b,c))
#define    sqr(x)         ((x)*(x))
#define    pi             2*acos(0.0)
#define    gcd(a,b)       __gcd(a,b)
#define    lcm(a,b)       (a/gcd(a,b))*b
#define    mem(a,b)       memset(a,b,sizeof (a))
#define    dec(x)         cout<<fixed<<setprecision(x)
#define    none(n)         __builtin_popcountll(n)

template < typename T > string toString ( T Number ) { stringstream ss ; ss << Number ; return ss.str() ; }
template < typename T > ll toll ( T str ) { stringstream ss ; ss << str ; ll num ; ss >> num ; return num ; }

const   int  N   =   2e5+7;
const   int  M   =   1e9+7;
const   ll  inf  =   0x7f7f7f7f7f7f7f7f;
const   int dx[] =   {+1,+2,+2,+1,-1,-2,-2,-1};
const   int dy[] =   {-2,-1,+1,+2,+2,+1,-1,-2};

ll a[N];

int main() {ikarus_101

    ll  n , m , i , j , k , x ;

    cin >> n >> k;
    for(i=0;i<n;i++)
        scanf("%lld",&a[i]);
    ll cnt = 0 ;
    for(i=1;i<n;i++)
    {
        if(a[i] < a[i-1])
        {
            ll dif = a[i-1]-a[i];
            ll lagbe = (dif + k -1) / k ;
            a[i] += lagbe * k ;
            cnt += lagbe ;
        }
        else if(a[i]==a[i-1]) {
            a[i] += k ;
            ++cnt;
        }
    }
    cout << cnt << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,d,count;
cin>>n>>d;
int arr[n];
for(int i=0;i<n;i++)
{
    cin>>arr[i];

}
for(int j=0;j<n;j=j+d)
{
    count=j;
}
cout<<count+1;
return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,d,count=0;
cin>>n>>d;
int arr[n];
for(int i=0;i<n;i++)
{
    cin>>arr[i];

}
for(int j=0;j<n;j++)
{
    for(int k=1;k<n;k++)
    {

    if(arr[j]<arr[k])
    {
    if(j+d<n)
    {
        count++;
    }
    }
    }
}
cout<<count;
return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,d,count=0;
cin>>n>>d;
int arr[n];
for(int i=0;i<n;i++)
{
    cin>>arr[i];

}
for(int j=0;j<=n;j++)
{
    if(j+d<=n)
    {
        count++;
    }
}
cout<<count;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int size,in,num=0,count=0;
cin>>size>>in;
int arr[size];
for(int i=0;i<size-1;i++)
{
if(arr[i]>=arr[i+1])
{
num=((arr[i]-arr[i+1])/in)+1;
arr[i+1]=arr[i+1]+in*count;
count=count+num;
}
}
cout<<count;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int size,in,num=0,count=0;
    cin>>size>>in;
    int arr[size];
    for(int j=0;j<size;j++)
    {
        cin>>arr[j];
    }
    for(int i=0;i<size-1;i++)
    {
    if(arr[i]>=arr[i+1])
    {
    num=((arr[i]-arr[i+1])/in)+1;
    arr[i+1]=arr[i+1]+in*num;
    count=count+num;
    }
    }
cout<<count;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,d,count=0;
cin>>n>>d;
int arr[n];
for(int i=0;i<n;i++)
{
    cin>>arr[i];

}
for(int j=0;j<n;j++)
{
    if(j+d<n)
    {
        count++;
    }
}
cout<<count+1;
return 0;
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>

main ()
{
	int k,d,a1,a2,ans,n;
	scanf("%d %d %d",&k,&d,&a1);

  for (int i=0; i<k-1; i++)
{
	scanf("%d",&a2);
	if (a2<=a1)
	{
		n=((a1-a2)/d)+1;
		a2+=d*n;
		ans+=n;
	}

	a1=a2;
}
	printf("%d",ans);
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int k,d,a1,a2,ans,n;
main ()
{
	int k,d,a1,a2,ans,n;
	scanf("%d %d %d",k,d,a1);

  for (int i=0; i<k-1; i++)
{
	scanf("%d",a2);
	if (a2<=a1)
	{
		n=((a1-a2)/d)+1;
		a2+=d*n;
		ans+=n;
	}

	a1=a2;
}
	printf("%d",ans);
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>

main ()
{
	int k,d,a1,a2,ans,n;
	scanf("%d %d %d",&k,&d,&a1);

  for (int i=0; i<k-1; i++)
{
	scanf("%d",a2);
	if (a2<=a1)
	{
		n=((a1-a2)/d)+1;
		a2+=d*n;
		ans+=n;
	}

	a1=a2;
}
	printf("%d",ans);
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>

main ()
{
	int k,d,a1,a2,ans=0,n;
	scanf("%d %d %d",&k,&d,&a1);

  for (int i=0; i<k-1; i++)
{
	scanf("%d",&a2);
	if (a2<=a1)
	{
		n=((a1-a2)/d)+1;
		a2+=d*n;
		ans+=n;
	}

	a1=a2;
}
	printf("%d",ans);
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>

main ()
{
	int k,d,a1,a2,ans,n;
	scanf("%d %d %d",k,d,a1);

  for (int i=0; i<k-1; i++)
{
	scanf("%d",a2);
	if (a2<=a1)
	{
		n=((a1-a2)/d)+1;
		a2+=d*n;
		ans+=n;
	}

	a1=a2;
}
	printf("%d",ans);
	return 0;
}


//*Here I go out to sea again
//*The sunshine fills my hair
//*And dreams hang in the air

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
void input(){freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);}

int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,k;
    cin>>n>>k;
    ll a[n];
    for(int i=0;i<n;i++){
      cin>>a[i];
    }
    ll c=0;
    for(int i=1;i<n;i++){
      if (a[i]<=a[i-1])
        {
            ll x=a[i-1]-a[i];
            c+=x/k+1;
            a[i]+=(x/k+1)*k;
        }
    }
    cout<<c<<"\n";

    return 0;
}


//*Here I go out to sea again
//*The sunshine fills my hair
//*And dreams hang in the air

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
void input(){freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);}

int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,k;
    cin>>n>>k;
    ll a[n];
    for(int i=0;i<n;i++){
      cin>>a[i];
    }
    ll c=0;
    for(int i=0;i<n-1;i++){
      if(a[i]>=a[i+1]){
        ll sum=(a[i]-a[i+1]);
        ll ans;
        if(sum%k==0 && sum!=0){
          ans=sum/k;
        }
        else{
          ans=(ll)(sum/k)+1;
        }
        a[i+1]=a[i+1]+(k*ans);
        c+=ans;
      }
    }
    cout<<c<<"\n";

    return 0;
}


//*Here I go out to sea again
//*The sunshine fills my hair
//*And dreams hang in the air

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
void input(){freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);}

int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,k;
    cin>>n>>k;
    ll a[n];
    for(int i=0;i<n;i++){
      cin>>a[i];
    }
    ll c=0;
    for(int i=0;i<n-1;i++){
      if(a[i]>=a[i+1]){
        ll sum=(a[i]-a[i+1]);
        if(sum%k==0 && sum!=0){
          c+=sum/k;
        }
        else{
          c+=(ll)(sum/k)+1;
        }
        a[i+1]=a[i+1]+k;
      }
    }
    cout<<c<<"\n";

    return 0;
}


//*Here I go out to sea again
//*The sunshine fills my hair
//*And dreams hang in the air

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
void input(){freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);}

int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,k;
    cin>>n>>k;
    ll a[n];
    for(int i=0;i<n;i++){
      cin>>a[i];
    }
    ll c=0;
    for(int i=0;i<n-1;i++){
      if(a[i]>=a[i+1]){
        ll sum=((a[i]+1)-a[i+1]);
        if(sum%k==0){
          c+=sum/k;
        }
        else{
          c+=(ll)(sum/k)+1;
        }
        a[i+1]=a[i]+1;
      }
    }
    cout<<c<<"\n";

    return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n,k,i,j=0;
	cin>>n>>k;
	int a[n];
	 cin>>a[0];
	 for(i=1;i<n;i++)
	{    cin>>a[i];
	    if(a[i-1]>=a[i])
	    {   j=j+1+(a[i-1]-a[i])/k;
	        a[i]=a[i]+k*(((a[i-1]-a[i])/k)+1);
	     }
	 	}
cout<<j;
}


#include <iostream>
using namespace std;

int main() {
	int n,k,i,j=0,p=0;
	cin>>n>>k;
	int a[n];
	for(i=0;i<n;i++)
	{
	    cin>>a[i];
	}
		for(i=0;i<n;i++)
	{
	    if(a[i]<a[i+1])
	    {

	    }
	    else
	    {
	    while(a[i]>a[i+1])
	    {
	        a[i+1]=a[i]+k;
	        j++;
	    }
	    }
	    p=p+j;
	}
	cout<<p;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n,k,i,j=0,p=0;
	cin>>n>>k;
	int a[n];
	for(i=0;i<n;i++)
	{
	    cin>>a[i];
	}
		for(i=1;i<n;i++)
	{
	    if(a[i-1]<a[i])
	    {

	    }
	    else
	    {
	    while(a[i-1]>=a[i])
	    {
	        a[i]=a[i]+k;
	        j++;
	    }
	    }

	}
	cout<<j;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n,k,i,j=0,p=0;
	cin>>n>>k;
	int a[n];
	for(i=0;i<n;i++)
	{
	    cin>>a[i];
	}
		for(i=0;i<n;i++)
	{
	    if(a[i]<a[i+1])
	    {

	    }
	    else
	    {
	    while(a[i]>a[i+1])
	    {
	        a[i+1]=a[i]+k;
	        j++;
	    }
	    }
	    p=p+j;
	}
	cout<<p;
	return 0;
}
}


#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
// #define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int gcd(int a, int b)
{
	if(b==0)
		return a;

	return gcd(a%b,b);
}

bool is_pallindrome(string str, int left, int right)
{
	if(left>right)
		return true;

	return (str[left]==str[right] && is_pallindrome(str, left+1, right-1));
}

int32_t main()
{
	c_p_c();

	// w(t)
	// {

	// 	cout<<'\n';
	// }

	int n,d,cnt=0;

	cin>>n>>d;

	int arr[n];

	for(int i=0; i<n; i++)
		cin>>arr[i];

	for(int j=1; j<n; j++)
	{
		if(arr[j-1]==arr[j])
		{
			cnt++;
			arr[j]+=d;
		}

		else if(arr[j-1]>arr[j])
		{
			int diff = arr[j-1]-arr[j];
			int ans = (diff)/d;
			int rem = (diff)%d;

			// if(rem==0)
			// 	cnt+=ans;
			// else
			// 	cnt+=ans+1;

			cnt+=ans+1;

			arr[j]+=(ans+1)*d;
		}
	}

	cout<<cnt;

	return 0;
}


#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
// #define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int gcd(int a, int b)
{
	if(b==0)
		return a;

	return gcd(a%b,b);
}

bool is_pallindrome(string str, int left, int right)
{
	if(left>right)
		return true;

	return (str[left]==str[right] && is_pallindrome(str, left+1, right-1));
}

int32_t main()
{
	c_p_c();

	// w(t)
	// {

	// 	cout<<'\n';
	// }

	int n,d,cnt=0;

	cin>>n>>d;

	int arr[n];

	for(int i=0; i<n; i++)
		cin>>arr[i];

	for(int j=1; j<n; j++)
	{
		if(arr[j-1]==arr[j])
		{
			cnt++;
			arr[j]+=d;
		}

		else if(arr[j-1]>arr[j])
		{
			int diff = arr[j-1]-arr[j];
			int ans = (diff+1)/d;
			int rem = (diff+1)%d;

			if(rem==0)
				cnt+=ans;
			else
				cnt+=ans+1;

			arr[j]+=diff+1;
		}
	}

	cout<<cnt;

	return 0;
}


#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
// #define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int gcd(int a, int b)
{
	if(b==0)
		return a;

	return gcd(a%b,b);
}

bool is_pallindrome(string str, int left, int right)
{
	if(left>right)
		return true;

	return (str[left]==str[right] && is_pallindrome(str, left+1, right-1));
}

int32_t main()
{
	c_p_c();

	// w(t)
	// {

	// 	cout<<'\n';
	// }

	int n,d,cnt=0;

	cin>>n>>d;

	int arr[n];

	for(int i=0; i<n; i++)
		cin>>arr[i];

	for(int j=1; j<n; j++)
	{
		if(arr[j-1]==arr[j])
		{
			cnt++;
			arr[j]+=d;
		}

		else if(arr[j-1]>arr[j])
		{
			int diff = arr[j-1]-arr[j];
			int ans = (diff+1)/d;
			int rem = (diff+1)%d;

			if(rem==0)
				cnt+=ans;
			else
				cnt+=ans+1;
		}
	}

	cout<<cnt;

	return 0;
}


#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
// #define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int gcd(int a, int b)
{
	if(b==0)
		return a;

	return gcd(a%b,b);
}

bool is_pallindrome(string str, int left, int right)
{
	if(left>right)
		return true;

	return (str[left]==str[right] && is_pallindrome(str, left+1, right-1));
}

int32_t main()
{
	c_p_c();

	// w(t)
	// {

	// 	cout<<'\n';
	// }

	int n,d,cnt=0;

	cin>>n>>d;

	int arr[n];

	for(int i=0; i<n; i++)
		cin>>arr[i];

	for(int j=1; j<n; j++)
	{
		if(arr[j-1]==arr[j])
		{
			cnt++;
			arr[j]+=d;
		}

		else if(arr[j-1]>arr[j])
		{
			int diff = arr[j-1]-arr[j];
			int ans = (diff)/d;
			int rem = (diff)%d;

			if(rem==0)
				cnt+=ans;
			else
				cnt+=ans+1;

			arr[j]+=(ans+rem)*d;
		}
	}

	cout<<cnt;

	return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n, d;
    cin >> n >> d;

    int ar[n];
    for(int i=0;i<n;++i)
        cin >> ar[i];

    int count = 0;

    for(int i=0;i<n;i++){
        if(ar[i] < ar[i + 1])
            ;
        else
            count += (ar[i] - ar[i + 1]) / d;

        if((ar[i] - ar[i + 1]) % d == 0)
            count++;

    }
    cout << count;

}


#include<iostream>
using namespace std;

int main()
{
    int n, d;
    cin >> n >> d;

    int ar[n];
    for(int i=0;i<n;++i)
        cin >> ar[i];

    int count = 0;

    for(int i=0;i<n;i++){
        if(ar[i] >= ar[i + 1]){

            if((ar[i] == ar[i + 1])){
                    count++;ar[i + 1] += d;
            }
            else {
                int t = (ar[i] - ar[i + 1]) / d;
                ar[i + 1] = ar[i + 1] + (t) * d;count += t;
                if((ar[i] - ar[i + 1]) % d != 0)
                    ar[t + 1] = ar[t + 1] + d;count++;
            }
            //ar[i + 1] = ar[i + 1] * ((ar[i] - ar[i + 1]) / d)
        }

    }
    cout << count;

}


#include<iostream>
using namespace std;

int main()
{
    int n, d;
    cin >> n >> d;

    int ar[n];
    for(int i=0;i<n;++i)
        cin >> ar[i];

    int count = 0;

    for(int i=0;i<n-1;i++)
    {
        if(ar[i] >= ar[i + 1]){

            if((ar[i] == ar[i + 1])){
                    count++;
                    ar[i + 1] += d;
            }
            else{
                //if((ar[i] - ar[i + 1]) % d != 0){
                    int t = (ar[i] - ar[i + 1] + d) / d;
                    ar[i + 1] += t * d;
                    count += t;
                //}

                /*int t = (ar[i] - ar[i + 1]) / d;
                ar[i + 1] += t * d;
                count += t;

                if((ar[i] - ar[i + 1]) % d != 0){
                    ar[i + 1] += d;
                    count++;
                }*/
            }
        }

    }
    cout << count;

}


#include<iostream>
using namespace std;

int main()
{
    int n, d;
    cin >> n >> d;

    int ar[n];
    for(int i=0;i<n;++i)
        cin >> ar[i];

    int count = 0;

    for(int i=0;i<n-1;i++){
        if(ar[i] >= ar[i + 1]){

            if((ar[i] == ar[i + 1])){
                    count++;ar[i + 1] += d;
            }
            else {
                int t = (ar[i] - ar[i + 1]) / d;
                ar[i + 1] = ar[i + 1] + (t) * d;count += t;
                if((ar[i] - ar[i + 1]) % d != 0)
                    ar[t + 1] = ar[t + 1] + d;count++;
            }
            //ar[i + 1] = ar[i + 1] * ((ar[i] - ar[i + 1]) / d)
        }

    }
    cout << count;

}


#include<iostream>
using namespace std;

int main()
{
    int n, d;
    cin >> n >> d;

    int ar[n];
    for(int i=0;i<n;++i)
        cin >> ar[i];

    int count = 0;

    for(int i=0;i<n-1;i++)
    {
        if(ar[i] >= ar[i + 1]){

            if((ar[i] == ar[i + 1])){
                    count++;
                    ar[i + 1] += d;
            }
            else {
                int t = (ar[i] - ar[i + 1]) / d;
                ar[i + 1] += t * d;
                count += t;

                if((ar[i] - ar[i + 1]) % d != 0){
                    ar[i + 1] += d;
                    count++;
                }
            }
            //ar[i + 1] = ar[i + 1] * ((ar[i] - ar[i + 1]) / d)
        }

    }
    cout << count;

}


//3 3
//18 1 9

#include<iostream>
using namespace std;

int main()
{
    int n, d;
    cin >> n >> d;

    int ar[n];
    for(int i=0;i<n;++i)
        cin >> ar[i];

    int count = 0;

    for(int i=0;i<n-1;i++)
    {
        if(ar[i] >= ar[i + 1]){

            if((ar[i] == ar[i + 1])){
                    count++;
                    ar[i + 1] += d;
            }
            else {
                int t = (ar[i] - ar[i + 1]) / d;
                ar[i + 1] += t * d;
                count += t;

                if((ar[i] - ar[i + 1]) % d != 0){
                    ar[t + 1] += d;
                    count++;
                }
            }
            //ar[i + 1] = ar[i + 1] * ((ar[i] - ar[i + 1]) / d)
        }

    }
    cout << count;

}


#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define ld long double
#define mod 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define tr(x,it) for(auto it = x.begin();it!=x.end();++it)
#define fpresent(x,c) ((c).find(x) != (c).end())  //set,map
#define present(c,x) (find(all(c),x) != (c).end()) //vector
#define pr(a,b) cout<<a<<" "<<b<<endl
#define pr1(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define pr2(a,b,c,d) cout<<a<<" " <<b<<" "<<c<<" "<<d<<endl
#define pb push_back
#define mp make_pair
#define INF 1e18
#define N 300001
#define F first
#define S second
#define iPair pair<int, int>

void code()
{
	int i, j, m, n, k, done = 0;
	cin>>m;
	string s, ans;
	cin>>s;
	n = s.size();
	int cnt[26] = {0};
	set<int> ss;
	for(i=0;i<n;i++)
		cnt[s[i]-'a']++;
	for(i=0;i<n-m+1;i++)
		ss.insert(n-1-i);
	std::vector<int> v[26];
	for(i=0;i<n;i++)
		v[s[i]-'a'].pb(i);
	for(i=0;i<26;i++){
		if(ss.size() == 0)
			break;
		int next = *(ss.begin());
		for(j=0;j<v[i].size();j++){
			if(ss.size() == 0)
				break;
			int ind = v[i][j];
			next = *ss.lower_bound(ind);
			if(j+1 == v[i].size() or v[i][j+1] > next){
				// pr1(i, j, ind);
				ans.pb('a'+i);
				cnt[i]--;
				// auto x = ss.begin();
				for(int xx = 0; xx < m ; xx++){
					// cerr<<xx<<endl;
					if(fpresent(xx+ind, ss)){
						// x = ss.begin();
						// x++;
						// next = *x;
						ss.erase(xx+ind);
					}
				}
			}
		}
	}
	for(i=0;i<25;i++){
		if(present(ans, 'a'+i+1)){
			for(j=0;j<cnt[i];j++)
				ans.pb('a'+i);
		}
	}
	sort(ans.begin(), ans.end());
	cout<<ans<<endl;
}

main()
{
	int tt,t;
	// cin>>t;
	t=1;
	for(tt = 1; tt<=t ; tt++){
		code();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define ld long double
#define mod 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define tr(x,it) for(auto it = x.begin();it!=x.end();++it)
#define fpresent(x,c) ((c).find(x) != (c).end())  //set,map
#define present(c,x) (find(all(c),x) != (c).end()) //vector
#define pr(a,b) cout<<a<<" "<<b<<endl
#define pr1(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define pr2(a,b,c,d) cout<<a<<" " <<b<<" "<<c<<" "<<d<<endl
#define pb push_back
#define mp make_pair
#define INF 1e18
#define N 300001
#define F first
#define S second
#define iPair pair<int, int>

void code()
{
	int i, j, m, n, k, done = 0;
	cin>>m;
	string s, ans;
	cin>>s;
	n = s.size();
	set<int> ss;
	for(i=0;i<n-m+1;i++)
		ss.insert(n-1-i);
	std::vector<int> v[26];
	for(i=0;i<n;i++)
		v[s[i]-'a'].pb(i);
	for(i=0;i<26;i++){
		if(ss.size() == 0)
			break;
		int next = *(ss.begin());
		for(j=0;j<v[i].size();j++){
			if(ss.size() == 0)
				break;
			int ind = v[i][j];
			if(j+1 == v[i].size() or v[i][j+1] > next){
				// pr1(i, j, ind);
				ans.pb('a'+i);
				auto x = ss.begin();
				for(int xx = 0; xx < m ; xx++){
					// cerr<<xx<<endl;
					if(fpresent(xx+ind, ss)){
						x = ss.begin();
						x++;
						next = *x;
						ss.erase(xx+ind);
						// pr("here", *(ss.begin()), , ss.size());
					}
				}
			}
		}
	}
	sort(ans.begin(), ans.end());
	cout<<ans<<endl;
}

main()
{
	int tt,t;
	// cin>>t;
	t=1;
	for(tt = 1; tt<=t ; tt++){
		code();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define ld long double
#define mod 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define tr(x,it) for(auto it = x.begin();it!=x.end();++it)
#define fpresent(x,c) ((c).find(x) != (c).end())  //set,map
#define present(c,x) (find(all(c),x) != (c).end()) //vector
#define pr(a,b) cout<<a<<" "<<b<<endl
#define pr1(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define pr2(a,b,c,d) cout<<a<<" " <<b<<" "<<c<<" "<<d<<endl
#define pb push_back
#define mp make_pair
#define INF 1e18
#define N 300001
#define F first
#define S second
#define iPair pair<int, int>

void code()
{
	int i, j, m, n, k, done = 0;
	cin>>m;
	string s, ans;
	cin>>s;
	n = s.size();
	set<int> ss;
	for(i=0;i<n-m+1;i++)
		ss.insert(n-1-i);
	std::vector<int> v[26];
	for(i=0;i<n;i++)
		v[s[i]-'a'].pb(i);
	for(i=0;i<26;i++){
		if(ss.size() == 0)
			break;
		int next = *(ss.begin());
		for(j=0;j<v[i].size();j++){
			if(ss.size() == 0)
				break;
			int ind = v[i][j];
			next = *ss.lower_bound(ind);
			if(j+1 == v[i].size() or v[i][j+1] > next){
				// pr1(i, j, ind);
				ans.pb('a'+i);
				// auto x = ss.begin();
				for(int xx = 0; xx < m ; xx++){
					// cerr<<xx<<endl;
					if(fpresent(xx+ind, ss)){
						// x = ss.begin();
						// x++;
						// next = *x;
						ss.erase(xx+ind);
					}
				}
			}
		}
	}
	sort(ans.begin(), ans.end());
	cout<<ans<<endl;
}

main()
{
	int tt,t;
	// cin>>t;
	t=1;
	for(tt = 1; tt<=t ; tt++){
		code();
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 0x7f7f7f7f
#define ms memset
#define MAX 100001

using namespace std;

ll a[27];
ll arr[MAX];
struct info
{
    int val,in;
};
info tree[MAX*3],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    if(tree[Left].val==tree[Right].val){
            tree[node].val = tree[Right].val;
            tree[node].in = tree[Right].in;
    }else{
        if(tree[Left].val<tree[Right].val){
            tree[node].val = tree[Left].val;
            tree[node].in = tree[Left].in;
        }else{
            tree[node].val = tree[Right].val;
            tree[node].in = tree[Right].in;
        }
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.val = INF;
        temp.in = -1;
        return temp;
    }
    if (b >= i && e <= j){
        temp.in = tree[node].in;
        temp.val = tree[node].val;
        return temp;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);
    if(p1.val == p2.val){
        if(p1.in < p2.in) return p2;
        else return p1;
    }else{
        if(p1.val < p2.val) return p1;
        else return p2;
    }
}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,cnt=0,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    //cout<<"arr: "<<arr[0]<<endl;
    for(i=1;i<=len;i++){
        cnt++;
        if(cnt%m==0){
            cnt--;
            info ret = query(1,1,len,last,last+m-1);
            //cout<<"RET: "<<ret.val<<" "<<ret.in<<" "<<arr[ret.val]<<" "<<(char)(ret.val-1+'a')<<endl;
            if( used == -1 || used!=ret.in) v.pb((char)(ret.val-1+'a'));
            used = ret.in;
            last++;
        }
    }sort(v.begin(),v.end());
    if(v.size()==0) v.pb(s[0]);
    for(i=0;i<v.size();i++) cout<<v[i];
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val >= tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>=p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    char mxx='a'-1;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            i = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
            mxx = max(mxx,(char)(last - 1 + 'a'));
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                i = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
                mxx = max(mxx,(char)(last - 1 + 'a'));
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< (char)v[inx] ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++){
        ans.pb(v[inx]);
    }

    sort(ans.begin(),ans.end());

    for(i=0;i<ans.size();i++){
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val >= tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>=p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    char mxx='a'-1;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            i = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
            mxx = max(mxx,(char)(last - 1 + 'a'));
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                i = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
                mxx = max(mxx,(char)(last - 1 + 'a'));
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< mxx ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++){
        ans.pb(v[inx]);
    }

    sort(ans.begin(),ans.end());

    for(i=0;i<ans.size();i++){
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    int val,in;
};
int arr[MAX];
info tree[MAX * 4],temp;
void init(int node, int b, int e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    int Left = node * 2;
    int Right = node * 2 + 1;
    int mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val > tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(int node, int b, int e, int i, int j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    int Left = node * 2;
    int Right = node * 2 + 1;
    int mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
            }
        }

    }sort(v.begin(),v.end());
    if(v.size()==0) v.pb(s[0]);
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< v[inx] ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++) ans.pb(v[inx]);
    sort(ans.begin(),ans.end());
    for(i=0;i<ans.size();i++) cout<<ans[i];
    cout<<endl;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val >= tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>=p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< v[inx] ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++){
        ans.pb(v[inx]);
    }

    sort(ans.begin(),ans.end());

    for(i=0;i<ans.size();i++){
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#define pb push_back
#define ll long long int
#define ull unsigned long long int
#define gcd(a,b)    __gcd(a,b)
#define sz sizeof
#define INF 30
#define ms memset
#define MAX 100010

using namespace std;

struct info{
    ll val,in;
};
ll arr[MAX];
info tree[MAX * 4],temp;
void init(ll node, ll b, ll e)
{
    if (b == e) {
        tree[node].val = arr[b];
        tree[node].in = b;
        return;
    }
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    init(Left, b, mid);
    init(Right, mid + 1, e);
    //tree[node] = tree[Left] + tree[Right];
    if(tree[Left].val >= tree[Right].val){
        tree[node].val = tree[Right].val;
        tree[node].in = tree[Right].in;
    }else{
        tree[node].val = tree[Left].val;
        tree[node].in = tree[Left].in;
    }
}
info query(ll node, ll b, ll e, ll i, ll j)
{
    if (i > e || j < b){
        temp.in = temp.val = INF;
        return temp;
    }
    if (b >= i && e <= j) return tree[node];
    ll Left = node * 2;
    ll Right = node * 2 + 1;
    ll mid = (b + e) / 2;
    info p1 = query(Left, b, mid, i, j);
    info p2 = query(Right, mid + 1, e, i, j);

    if(p1.val>=p2.val) return p2;
    else return p1;

}

int main()
{
    //freopen("a.in","r",stdin);
    //freopen("out.txt","w",stdout);
    //std::ios_base::sync_with_stdio(false);
    ll i,j,len,mn=30,m,last=1,in;
    ll used = -1;
    string s;
    vector<char>v,ans;
    char mxx='a'-1;
    cin>>m>>s;
    len = s.length();
    for(i=0;i<s.length();i++){
        arr[i+1] = s[i]-'a' + 1;
    }
    init(1,1,len);
    for(i=1;i<=len-m+1;i++){
        info ret = query(1,1,len,i,i+m-1);
        if(used==-1){
            used = ret.in;
            i = ret.in;
            last = ret.val;
            v.pb(last - 1 + 'a');
            mxx = max(mxx,(char)(last - 1 + 'a'));
        }else{
            if(ret.val == last && used==ret.in){}
            else{
                used = ret.in;
                i = ret.in;
                last = ret.val;
                v.pb(last - 1 + 'a');
                mxx = max(mxx,(char)(last - 1 + 'a'));
            }
        }

    }
    if(v.size()==0) v.pb(s[0]);
    sort(v.begin(),v.end());
    ll inx = v.size()-1;
    ll cnt=0;
    for(i=0;i<v.size();i++){
        if(v[i]==v[inx]) cnt++;
    }
    for(i=0;i<s.length();i++){
        if(s[i]< v[inx] ) ans.pb(s[i]);
    }
    for(i=1;i<=cnt;i++){
        ans.pb(v[inx]);
    }

    sort(ans.begin(),ans.end());

    for(i=0;i<ans.size();i++){
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}