import java.io.*;

/**
 * Created by dalt on 2018/4/2.
 */
public class CF926I {
    public static final int MOD = (int) (1e9 + 7);
    public static BlockReader input;
    public static PrintStream output;

    public static void main(String[] args) throws FileNotFoundException {

        init();

        solve();

        output.flush();
    }

    public static void init() throws FileNotFoundException {
        if (System.getProperty("ONLINE_JUDGE") == null) {
            input = new BlockReader(new FileInputStream("D:\\DataBase\\TESTCASE\\codeforces\\CF926I.in"));
            output = System.out;
        } else {
            input = new BlockReader(System.in);
            output = new PrintStream(new BufferedOutputStream(System.out), false);
        }

    }

    public static void solve() {
        int n = input.nextInteger();
        boolean[] alarm = new boolean[24 * 60];

        char[] time = new char[5];
        int firstAlarm = 24 * 60;
        int lastAlarm = -1;
        for (int i = 0; i < n; i++) {
            input.nextBlock(time, 0);

            int h = (time[0] - '0') * 10 + (time[1] - '0');
            int m = (time[3] - '0') * 10 + (time[4] - '0');
            int timestamp = h * 60 + m;
            alarm[timestamp] = true;

            firstAlarm = Math.min(firstAlarm, timestamp);
            lastAlarm = Math.max(lastAlarm, timestamp);
        }

        int best = 24 * 60 - 1 - lastAlarm + firstAlarm;

        int bpos = 0;
        for (int i = 0, until = alarm.length; i < until; i++) {
            if (alarm[i]) {
                best = Math.max(best, i - bpos - 1);
                bpos = i;
            }
        }
        best = Math.max(best, alarm.length - bpos - 1);

        int h = best / 60;
        int m = best % 60;
        output.println(String.format("%d%d:%d%d", h / 10, h % 10, m / 10, m % 10));
    }

    public static class BlockReader {
        static final int EOF = -1;
        InputStream is;
        byte[] dBuf;
        int dPos, dSize, next;
        StringBuilder builder = new StringBuilder();

        public BlockReader(InputStream is) {
            this(is, 4096);
        }

        public BlockReader(InputStream is, int bufSize) {
            this.is = is;
            dBuf = new byte[bufSize];
            next = nextByte();
        }

        public int nextByte() {
            while (dPos >= dSize) {
                if (dSize == -1) {
                    return EOF;
                }
                dPos = 0;
                try {
                    dSize = is.read(dBuf);
                } catch (Exception e) {
                }
            }
            return dBuf[dPos++];
        }

        public String nextBlock() {
            builder.setLength(0);
            skipBlank();
            while (next != EOF && !Character.isWhitespace(next)) {
                builder.append((char) next);
                next = nextByte();
            }
            return builder.toString();
        }

        public void skipBlank() {
            while (Character.isWhitespace(next)) {
                next = nextByte();
            }
        }

        public int nextInteger() {
            skipBlank();
            int ret = 0;
            boolean rev = false;
            if (next == '+' || next == '-') {
                rev = next == '-';
                next = nextByte();
            }
            while (next >= '0' && next <= '9') {
                ret = (ret << 3) + (ret << 1) + next - '0';
                next = nextByte();
            }
            return rev ? -ret : ret;
        }

        public long nextLong() {
            skipBlank();
            long ret = 0;
            boolean rev = false;
            if (next == '+' || next == '-') {
                rev = next == '-';
                next = nextByte();
            }
            while (next >= '0' && next <= '9') {
                ret = (ret << 3) + (ret << 1) + next - '0';
                next = nextByte();
            }
            return rev ? -ret : ret;
        }

        public int nextBlock(char[] data, int offset) {
            skipBlank();
            int index = offset;
            int bound = data.length;
            while (next != EOF && index < bound && !Character.isWhitespace(next)) {
                data[index++] = (char) next;
                next = nextByte();
            }
            return index - offset;
        }

        public boolean hasMore() {
            skipBlank();
            return next != EOF;
        }
    }
}


import java.io.*;

/**
 * Created by dalt on 2018/4/2.
 */
public class CF926I {
    public static final int MOD = (int) (1e9 + 7);
    public static BlockReader input;
    public static PrintStream output;

    public static void main(String[] args) throws FileNotFoundException {

        init();

        solve();

        output.flush();
    }

    public static void init() throws FileNotFoundException {
        if (System.getProperty("ONLINE_JUDGE") == null) {
            input = new BlockReader(new FileInputStream("D:\\DataBase\\TESTCASE\\codeforces\\CF926I.in"));
            output = System.out;
        } else {
            input = new BlockReader(System.in);
            output = new PrintStream(new BufferedOutputStream(System.out), false);
        }

    }

    public static void solve() {
        int n = input.nextInteger();
        boolean[] alarm = new boolean[24 * 60];

        char[] time = new char[5];
        int firstAlarm = 24 * 60;
        int lastAlarm = -1;
        for (int i = 0; i < n; i++) {
            input.nextBlock(time, 0);

            int h = (time[0] - '0') * 10 + (time[1] - '1');
            int m = (time[3] - '0') * 10 + (time[4] - '1');
            int timestamp = h * 60 + m;
            alarm[timestamp] = true;

            firstAlarm = Math.min(firstAlarm, timestamp);
            lastAlarm = Math.max(lastAlarm, timestamp);
        }

        int best = 24 * 60 - 1 - lastAlarm + firstAlarm;

        int bpos = 0;
        for (int i = 0, until = alarm.length; i < until; i++) {
            if (alarm[i]) {
                best = Math.max(best, i - bpos - 1);
                bpos = i;
            }
        }
        best = Math.max(best, alarm.length - bpos - 1);

        int h = best / 60;
        int m = best % 60;
        output.println(String.format("%d%d:%d%d", h / 10, h % 10, m / 10, m % 10));
    }

    public static class BlockReader {
        static final int EOF = -1;
        InputStream is;
        byte[] dBuf;
        int dPos, dSize, next;
        StringBuilder builder = new StringBuilder();

        public BlockReader(InputStream is) {
            this(is, 4096);
        }

        public BlockReader(InputStream is, int bufSize) {
            this.is = is;
            dBuf = new byte[bufSize];
            next = nextByte();
        }

        public int nextByte() {
            while (dPos >= dSize) {
                if (dSize == -1) {
                    return EOF;
                }
                dPos = 0;
                try {
                    dSize = is.read(dBuf);
                } catch (Exception e) {
                }
            }
            return dBuf[dPos++];
        }

        public String nextBlock() {
            builder.setLength(0);
            skipBlank();
            while (next != EOF && !Character.isWhitespace(next)) {
                builder.append((char) next);
                next = nextByte();
            }
            return builder.toString();
        }

        public void skipBlank() {
            while (Character.isWhitespace(next)) {
                next = nextByte();
            }
        }

        public int nextInteger() {
            skipBlank();
            int ret = 0;
            boolean rev = false;
            if (next == '+' || next == '-') {
                rev = next == '-';
                next = nextByte();
            }
            while (next >= '0' && next <= '9') {
                ret = (ret << 3) + (ret << 1) + next - '0';
                next = nextByte();
            }
            return rev ? -ret : ret;
        }

        public long nextLong() {
            skipBlank();
            long ret = 0;
            boolean rev = false;
            if (next == '+' || next == '-') {
                rev = next == '-';
                next = nextByte();
            }
            while (next >= '0' && next <= '9') {
                ret = (ret << 3) + (ret << 1) + next - '0';
                next = nextByte();
            }
            return rev ? -ret : ret;
        }

        public int nextBlock(char[] data, int offset) {
            skipBlank();
            int index = offset;
            int bound = data.length;
            while (next != EOF && index < bound && !Character.isWhitespace(next)) {
                data[index++] = (char) next;
                next = nextByte();
            }
            return index - offset;
        }

        public boolean hasMore() {
            skipBlank();
            return next != EOF;
        }
    }
}


import java.io.*;
import java.util.*;

public class I {
    String fileName = "I";

    public void solve() throws IOException {
        int n = nextInt();
        List<Integer> times = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            String s = nextToken();
            String[] tmp = s.split(":");
            int h = Integer.parseInt(tmp[0]);
            int m = Integer.parseInt(tmp[1]);
            int total = h * 60 + m;
            times.add(total);
        }
        Collections.sort(times);
        List<Integer> segments = new ArrayList<>(n);
        for (int i = 1; i < times.size(); i++) {
            segments.add(times.get(i) - times.get(i - 1) - 1);
        }
        segments.add(1439 - times.get(times.size() - 1) + times.get(0));
        int ans = Collections.max(segments);
        out.printf("%02d:%02d", ans / 60, +ans % 60);
    }

    public void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new I().run();
    }
}


import java.util.Scanner;
import java.lang.String;
import java.lang.Math;
 import java.util.Arrays;
 import java.util.Collections;

public class Olymp {

 private static Scanner ob;

 public static void main(String[] args){
  ob = new Scanner(System.in);
  int a=ob.nextInt();
  if (a==1) System.out.print("23:59");
  else {
      String b;
      int[] my  = new int[a];
      for (int i = 0; i< a;i++){
        b =ob.next();
        int time  =  Character.getNumericValue(b.charAt(0))*60*10  +  Character.getNumericValue(b.charAt(1))*60 +  Character.getNumericValue(b.charAt(3))*10 +  Character.getNumericValue(b.charAt(4));
        my[i] = time;
      }
      Arrays.sort(my);
      int[] my2  = new int[a];
      for (int i = 1;i<a;i++){
          my2[i] = my[i] - my[i-1] -1;
      }

      my2[0] = my[0] + 24*60 - my[a-1] -1;

    Arrays.sort(my2);
    int all = my2[a-1];
      int h1 = all/600;
      all = all - h1*600;
      int h2 = all/60;
      all = all - h2*60;
      int m1 = all/10;
      all = all  - m1*10;
      System.out.print(h1);
            System.out.print(h2);
      System.out.print(":");
      System.out.print(m1);
      System.out.print(all);

  }

  }
}


import java.util.Scanner;
import static java.lang.Math.*;
public class HelloWorld
{
	public static void main(String[] args) {
	    Scanner reader = new Scanner(System.in);
	    int n = reader.nextInt(), ans = 0;
	    boolean[] us = new boolean[1440];

	    for(int i = 0; i < n; i++)
	    {
	       String s = reader.next();
	       int h = Character.getNumericValue(s.charAt(0)) * 10 + Character.getNumericValue(s.charAt(1));
	       int m = Character.getNumericValue(s.charAt(3)) * 10 + Character.getNumericValue(s.charAt(4));
	       us[h*60 + m] = true;
	    }
	    int cur = 0;
	    for(int it = 0; it < 2; it++)
	    {
    	    for(int i = 0; i < 1440; i++)
    	    {
    	       if(us[i] == true)
    	       {
    	           ans = max(ans, cur);
    	           cur = 0;
    	       }
    	       else
    	       {
    	            cur++;

    	       }
    	    }
	    }
	    int h = ans / 60, m = ans % 60;
	    char c1 = (char)((h/10) + '0'), c2 = (char)((h%10) + '0'), c3 = (char)((m/10) + '0'), c4 = (char)((m%10) + '0');
	    String s = "" + c1 + c2 + ':' + c3 + c4;
	    System.out.println(s);
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Ideone
{
        public static void main (String[] args)
        {
         Scanner sc = new Scanner(System.in);
         int n = sc.nextInt();
         String s;
         int []A = new int [n];
         sc.nextLine();
         for(int i = 0; i < n; i++)
         {
             s = sc.nextLine();
             A[i] += s.charAt(4) - '0';
             A[i] += (s.charAt(3) - '0')*10;
             A[i] += 60*(s.charAt(1) - '0');
             A[i] += 60*(s.charAt(0) - '0')*10;
         }
         Arrays.sort(A);
         int Max = A[0] + 24*60 - A[n-1];
         for(int i = 1; i < n; i++)
         {
         	if(A[i] - A[i-1] > Max)
         	Max = A[i] - A[i-1];
         }
         Max--;
               if(Max/60 < 10)
               System.out.printf("0");
               System.out.printf("%d",Max/60);
               System.out.printf(":");
               if(Max%60 < 10)
               System.out.printf("0");
               System.out.printf("%d",Max%60);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class project
{
    public static void main(String[]args)
    {
    	int[] time = new int[150];
		Scanner s = new Scanner(System.in);
		int n =s.nextInt();
		for(int i=0;i<n;i++)
		{
		    String tmp=s.next();
		    int hh = Integer.parseInt(tmp.substring(0, 2));
			int mm = Integer.parseInt(tmp.substring(3, 5));
			time[i]=hh*60+mm;
		}
		Arrays.sort(time, 0, n);
		int ans=0;
		for(int i=1;i<n;i++)
		{
			if(time[i]-time[i-1]-1>ans)
				ans=time[i]-time[i-1]-1;
		}
		if(time[0]+24*60-time[n-1]-1>ans)
			ans=time[0]+24*60-time[n-1]-1;

		if(ans/60<10)
		System.out.print(0);
		System.out.print(ans/60+":");
		if(ans%60<10)
		System.out.print(0);
		System.out.println(ans%60);
    }
}


import java.util.Scanner;
public class project
{
    public static void main(String[]args)
    {
    	int[] time = new int[150];
		Scanner s = new Scanner(System.in);
		int n =s.nextInt();
		for(int i=0;i<n;i++)
		{
		    String tmp=s.next();
		    int hh = Integer.parseInt(tmp.substring(0, 2));
			int mm = Integer.parseInt(tmp.substring(3, 5));
			time[i]=hh*60+mm;
		}
		Arrays.sort(time, 0, n);
		int ans=0;
		for(int i=1;i<n;i++)
		{
			if(time[i]-time[i-1]-1>ans)
				ans=time[i]-time[i-1]-1;
		}
		if(time[0]+23*60+59-time[n-1]-1>ans)
			ans=time[0]+23*60+59-time[n-1]-1;

		System.out.println(ans/60+":"ans%60);
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class project
{
    public static void main(String[]args)
    {
    	int[] time = new int[150];
		Scanner s = new Scanner(System.in);
		int n =s.nextInt();
		for(int i=0;i<n;i++)
		{
		    String tmp=s.next();
		    int hh = Integer.parseInt(tmp.substring(0, 2));
			int mm = Integer.parseInt(tmp.substring(3, 5));
			time[i]=hh*60+mm;
		}
		Arrays.sort(time, 0, n);
		int ans=0;
		for(int i=1;i<n;i++)
		{
			if(time[i]-time[i-1]-1>ans)
				ans=time[i]-time[i-1]-1;
		}
		if(time[0]+24*60-time[n-1]-1>ans)
			ans=time[0]+24*60-time[n-1]-1;

		System.out.println(ans/60+":"+ans%60);
    }
}


import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static PrintStream out = System.out;
    public static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int n = in.nextInt();
        int[] a = new int[n * 2];
        for (int i = 0; i < n; i++) {
            String s = in.next();
            int h = (s.charAt(0) - '0') * 10 + (s.charAt(1) - '0');
            int m = (s.charAt(3) - '0') * 10 + (s.charAt(4) - '0');
            a[i * 2] = h * 60 + m;
            a[i * 2 + 1] = h * 60 + m + 24 * 60;
        }
        Arrays.sort(a);
        int best = 0;
        for (int i = 0; i < n * 2 - 1; i++) {
            best = Math.max(best, a[i + 1] - a[i] - 1);
        }
        int h = best / 60, m = best % 60;
        out.print(h / 10);
        out.print(h % 10);
        out.print(":");
        out.print(m / 10);
        out.print(m % 10);
        out.println();
    }
}


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Test3 {
    private static class BufferedScanner implements Closeable {
        BufferedReader mReader;
        StringTokenizer mTokenizer;

        BufferedScanner(InputStream inputStream) {
            mReader = new BufferedReader(new InputStreamReader(inputStream));
        }

        String next() {
            while (mTokenizer == null || !mTokenizer.hasMoreElements()) {
                String line = readLine();
                if (line != null) {
                    mTokenizer = new StringTokenizer(line);
                } else {
                    break;
                }
            }
            return mTokenizer != null ? mTokenizer.nextToken() : null;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            return readLine();
        }

        private String readLine() {
            try {
                return mReader.readLine();
            } catch (IOException ignore) {
                return null;
            }
        }

        @Override
        public void close() throws IOException {
            mReader.close();
        }
    }

    private static InputStream getInputStream() throws IOException {
        InputStream inputStream;
        if (System.getProperty("ONLINE_JUDGE") != null) {
            inputStream = System.in;
        } else {
            File inputFile = new File("input.txt");
            if (!inputFile.exists()) {
                //noinspection ResultOfMethodCallIgnored
                inputFile.createNewFile();
                throw new FileNotFoundException("File wasn't found, but now is created");
            }
            inputStream = new FileInputStream(inputFile);
        }
        return new BufferedInputStream(inputStream);
    }

    public static void main(String[] args) throws IOException {
        try (BufferedScanner in = new BufferedScanner(getInputStream());
             PrintWriter out = new PrintWriter(System.out)) {
            new Test3(in, out).solve();
            out.flush();
        }
    }

    private BufferedScanner in;
    private PrintWriter out;

    private Test3(BufferedScanner in, PrintWriter out) throws IOException {
        this.in = in;
        this.out = out;
    }

    private void solve() throws IOException {
        int n=in.nextInt();
        ArrayList<Integer> al=new ArrayList<>();
        for(int i=0;i<n;i++) {
        	String str=in.nextLine();
        	int[] a=Arrays.stream(str.split(":")).mapToInt(Integer::parseInt).toArray();
        	al.add(a[0]*60+a[1]);
        }
        al.sort(Comparator.naturalOrder());
        int max=Integer.MIN_VALUE;
    	int last=al.get(0);
    	for(int i=1;i<al.size();i++) {
    		int curr=al.get(i);
    		max=Math.max(max, curr-last-1);
    		last=curr;
    	}
        max=Math.max(max, 1440+al.get(0)-last-1);
        System.out.printf("%02d:%02d", max/60,max%60);

    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class T {

    static String u2(int v) {
        String s = Integer.toString(v);
        return s.length() == 1 ? "0" + s : s;
    }
    public static void main(String[] a) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> al = new ArrayList<>();
        int t = sc.nextInt();
        sc.nextLine();
        for(int i = 0; i < t; i++) {
            String[] l = sc.nextLine().split(":");
            int val = Integer.parseInt(l[0]) * 60 + Integer.parseInt(l[1]);
            al.add(val);
        }
        al.sort(Integer::compare);
        int longest = 0;
        int prev = -1;
        for(Integer e : al) {
            if(prev != -1) {
                int v = e - prev - 1;
                if(longest < v) longest = v;
            }
            prev = e;
        }
        if(al.size() >= 1) {
            int v = al.get(0) + 24*60 - al.get(al.size() - 1) - 1;
            if(longest < v) longest = v;
        }

        System.out.print(u2(longest / 60));
        System.out.print(":");
        System.out.println(u2(longest % 60));
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class Task_8 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        ArrayList<Integer> time = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            String input = scanner.nextLine();
            int minute = Integer.parseInt(input.substring(0,2))*60 + Integer.parseInt(input.substring(3,5));
            for (int j = 0; j < time.size(); j++) {
                if(time.get(j) > minute || j == time.size()-1){
                    time.add(j, minute);
                    break;
                }
            }
            if(time.size() == 0){
                time.add(minute);
            }
        }
        int max = 0;
        for (int i = 0; i < n-1; i++) {
            int r = time.get(i+1) - time.get(i);
            if(r > max){
                max = r;
            }
        }
        int alt = 24*60-time.get(n-1)+time.get(0);
        if(alt > max){
            max = alt;
        }
        max--;
        String h = ""+max / 60;
        if(h.length() == 1){
            h = "0"+h;
        }
        String m = ""+max % 60;
        if(m.length() == 1){
            m = "0"+m;
        }
        else if(m.length()==0){
            m="00";
        }
        System.out.println(h+":"+m);
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class Task_8 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        ArrayList<Integer> time = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            String input = scanner.nextLine();
            int minute = Integer.parseInt(input.substring(0,2))*60 + Integer.parseInt(input.substring(3,5));
            for (int j = 0; j < time.size(); j++) {
                if(time.get(j) > minute || time.get(j)==0){
                    time.add(j, minute);
                    break;
                }
            }
            if(time.size() == 0){
                time.add(minute);
            }
        }
        int max = 0;
        for (int i = 0; i < n-1; i++) {
            int r = time.get(i+1) - time.get(i);
            if(r > max){
                max = r;
            }
        }
        int alt = 24*60-time.get(n-1)+time.get(0);
        if(alt > max){
            max = alt;
        }
        max--;
        String h = ""+max / 60;
        if(h.length() == 1){
            h = "0"+h;
        }
        String m = ""+max % 60;
        if(m.length() == 1){
            m = "0"+m;
        }
        else if(m.length()==0){
            m="00";
        }
         System.out.println(h+":"+m);
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class Task_8 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        ArrayList<Integer> time = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            String input = scanner.nextLine();
            int minute = Integer.parseInt(input.substring(0,2))*60 + Integer.parseInt(input.substring(3,5));
            for (int j = 0; j < time.size(); j++) {
                if(time.get(j) > minute){
                    time.add(j, minute);
                    break;
                }
                else if(j == time.size()-1){
                    time.add(minute);
                    break;
                }
            }
            if(time.size() == 0){
                time.add(minute);
            }
        }
        int max = 0;
        for (int i = 0; i < n-1; i++) {
            int r = time.get(i+1) - time.get(i);
            if(r > max){
                max = r;
            }
        }
        int alt = 24*60-time.get(n-1)+time.get(0);
        if(alt > max){
            max = alt;
        }
        max--;
        String h = ""+max / 60;
        if(h.length() == 1){
            h = "0"+h;
        }
        String m = ""+max % 60;
        if(m.length() == 1){
            m = "0"+m;
        }
        else if(m.length()==0){
            m="00";
        }
        System.out.println(h+":"+m);
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class Task_8 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        ArrayList<Integer> time = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            String input = scanner.nextLine();
            int minute = Integer.parseInt(input.substring(0,2))*60 + Integer.parseInt(input.substring(3,5));
            for (int j = 0; j < time.size(); j++) {
                if(time.get(j) > minute || time.get(j)==0){
                    time.add(j, minute);
                    break;
                }
            }
            if(time.size() == 0){
                time.add(minute);
            }
        }
        int max = 0;
        for (int i = 0; i < n-1; i++) {
            int r = time.get(i+1) - time.get(i);
            if(r > max){
                max = r;
            }
        }
        int alt = 24*60-time.get(n-1)+time.get(0);
        if(alt > max){
            max = alt;
        }
        max--;
        String h = ""+max / 60;
        if(h.length() == 1){
            h = "0"+h;
        }
        String m = ""+max % 60;
        if(m.length() == 1){
            m = "0"+m;
        }
        else if(m.length()==0){
            m="00";
        }
        System.out.println(h+":"+m);
    }
}


import java.util.*;

public class Factorial{

    public static void main(String[] args){
        int n;
        Scanner s =new Scanner(System.in);
        n = s.nextInt();
        int max = 0;
        int[] a = new int[n];
        for(int i = 0;i<n;i++){
            String s1 = s.next();
            int x1 = new Integer(s1.substring(0,2))
                    ,x2 = new Integer(s1.substring(3,5));

            a[i] = x1*60 +x2;
        }
        Arrays.sort(a);
        for(int i = 1;i<n;i++){
            if(a[i] - a[i-1] > max) max = a[i] - a[i-1];
        }
        if(a[0] + 1440 - a[n-1] > max) max = a[0] + 1440 - a[n-1];
        max--;
        System.out.println(((max/60 > 9)? max/60 : "0"+max/60)+":"
                +((max%60 > 9)? max%60 : "0" + max%60));
    }
}


import java.util.*;

public class I {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int lines = Integer.parseInt(sc.nextLine());
		List<Integer> alarms = new ArrayList<>();
		for (int i = 0; i < lines; i++) {
			int[] s = Arrays.stream(sc.nextLine().split(":")).mapToInt(Integer::parseInt).toArray();
			int time = s[0] * 60 + s[1];
			alarms.add(time);
		}

		alarms.sort(Comparator.naturalOrder());
		int maxLength = Integer.MIN_VALUE;
		int last = alarms.get(0);
		for (int i = 1; i < alarms.size(); i++) {
			int curr = alarms.get(i);
			maxLength = Math.max(maxLength, curr-last-1);
			last = curr;
		}
		maxLength = Math.max(maxLength, 1440-last + alarms.get(0) - 1);

		System.out.printf("%02d:%02d", maxLength/60, maxLength % 60);
	}
}


import java.util.*;

public class I {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int lines = Integer.parseInt(sc.nextLine());
		List<Integer> alarms = new ArrayList<>();
		for (int i = 0; i < lines; i++) {
			int[] s = Arrays.stream(sc.nextLine().split(":")).mapToInt(Integer::parseInt).toArray();
			int time = s[0] * 60 + s[1];
			alarms.add(time);
		}

		alarms.sort(Comparator.naturalOrder());
		int maxLength = Integer.MIN_VALUE;
		int last = alarms.get(0);
		for (int i = 1; i < alarms.size(); i++) {
			int curr = alarms.get(i);
			maxLength = Math.max(maxLength, curr-last-1);
			last = curr;
		}
		maxLength = Math.max(maxLength, 1440-last + alarms.get(0) - 1);

		System.out.printf("%d:%d", maxLength/60, maxLength % 60);
	}
}


var n=parseInt(readline());
var i,j,cur,Max,t;
var arr=[];
for(i = 0; i < n; i++){
    t = readline().split(':').map(el => parseInt(el));
    arr.push(t[0]*60+t[1]);
}
arr.sort((a, b) => a-b)
cur = arr[arr.length - 1] - 24 * 60 + 1;
Max = 0;
for(i = 0; i < n; i++){
    Max = Math.max(arr[i] - cur, Max);
    cur = arr[i] + 1;
}
print((Math.floor(Max/60) < 10 ? '0' : '') + Math.floor(Max/60) +':'+(Max%60 < 10 ? '0':'') + Max%60);


var n = parseInt(readline());
var arr = [];
for(var i = 0; i < n; i++){
    var t = readline().split(':').map(el => parseInt(el));
    arr.push(t[0]*60+t[1]);
}
arr.sort((a, b) => a-b)
var cur = arr[arr.length - 1] - 24 * 60 + 1;
var Max = 0;
for(var i = 0; i < n; i++){
    Max = Math.max(arr[i] - cur, Max);
    cur = arr[i] + 1;
}
print(Math.floor(Max/60)+':'+Max%60);


var n = parseInt(readline());
var arr = [];
for(var i = 0; i < n; i++){
    var t = readline().split(':').map(el => parseInt(el));
    arr.push(t[0]*60+t[1]);
}
arr.sort((a, b) => a-b)
var cur = arr[arr.length - 1] - 24 * 60 + 1;
var Max = 0;
for(var i = 0; i < n; i++){
    Max = Math.max(arr[i] - cur, Max);
    cur = arr[i] + 1;
}
print((Math.floor(Max/60) < 10 ? '0' : '') + Math.floor(Max/60) +':'+(Max%60 < 10 ? '0':'') + Max%60);


function sortFunction(a, b){
  if(a < b)
     return -1
  if(a > b)
     return 1
  return 0
}

var nn = readline().split(" ").map(v => +v.trim());
var n = nn[0];
//print(n);
var a = [];

for (var i = 0; i < n; i++) {
    var tmp = readline().split(":").map(v => +v.trim());
    var cur = 60 * tmp[0] + tmp[1];
    //print(cur);
    a.push(cur);
}

a = a.sort(sortFunction)
a.push(a[0] + 24 * 60);
//print(a);
var mx = 0;
for (var i = 0; i < n; i++) {
    var cur = a[i + 1] - a[i] - 1;
    if (mx < cur) {
        mx = cur;
    }
}
//print(mx);
var h = Math.floor( mx / 60 );
var m = mx - h * 60;
if (h < 10 && m < 10) {
    print("0" + h + ":" + "0" + m);
}
else if (h < 10) {
    print("0" + h + ":" + m);
}
else if (m < 10) {
    print(h + ":" + "0" + m);
}
else {
    print(h + ":" + m);
}


var n;
var arr = new Array();
n = readline();
for (var i = 0; i < n; ++i) {
    var s = readline();
    var t = parseInt(parseInt(s[0]) * 600 + parseInt(s[1]) * 60 + parseInt(s[3]) * 10 + parseInt(s[4]));
    arr[i] = t;
}
arr.sort(function(a, b){return parseInt(a) - parseInt(b)});
arr[n] = parseInt(parseInt(arr[0]) + parseInt(1440));
var ans = 0;
for (var i = 0; i < n; ++i) {
    ans = Math.max(ans, parseInt(arr[i + 1]) - parseInt(arr[i]) - 1);
}
var q = "" + parseInt(parseInt(ans) / parseInt(600)) + "" + parseInt(parseInt(ans) / parseInt(60)) % 10 + ":" + parseInt(ans / 10) % 6 + parseInt(ans % 10);
print(q);


var n = parseInt(readline());
var a = [];
for(var i=0;i<n;++i){
    var time = readline().split(':').map(function(x){return parseInt(x);});
    a.push(time[0]*60 + time[1]);
}
a.sort(function (a, b) {return a-b;});
var ans = a[0]+24*60 - a[a.length-1] - 1;
for(var i=1;i<n+2;++i){
    if(a[i]-a[i-1]-1 > ans){
        ans = a[i]-a[i-1]-1;
    }
}
var h = parseInt(ans/60);
if(h<10)
    h = '0' + h;
var m = ans%60;
if(m<10)
    m = '0'+m;
print(h+':'+m);


var n = readline();
var tmp = [];
var time = new Array();
var s;

for (var i = 0; i < 1440; ++i) {
    time[i] = false;
}

for (var i = 0; i < n; ++i) {
    s = readline();
    if (s != undefined) {
        tmp = s.split(":");
    }
    time[parseInt(tmp[0] * 60) + parseInt(tmp[1])] = true;
}

var cur = 0, max = 0, first = -1, last = 0;

for (var i = 0; i < 1440; ++i) {
    if (!time[i]) {
        cur++;
    }
    if (time[i]) {
        if (max < cur) {
            max = cur;
        }
        last = i;
        if (first == -1) {
            first = i;
        }
        cur = 0;
    }
}

if (max < first + 1440 - last) {
    max = first + 1440 - last;
}

print(("0" + Math.floor(max / 60)).slice(-2) + ":" + ("0" + max % 60).slice(-2));


var n = readline();
var tmp = [];
var time = new Array();
var s;

for (var i = 0; i < 1440; ++i) {
    time[i] = false;
}

for (var i = 0; i < n; ++i) {
    s = readline();
    if (s != undefined) {
        tmp = s.split(":");
    }
    time[parseInt(tmp[0] * 60) + parseInt(tmp[1])] = true;
}

var cur = 0, max = 0, first = -1, last = 0;

for (var i = 0; i < 1440; ++i) {
    if (!time[i]) {
        cur++;
    }
    if (time[i]) {
        if (max < cur) {
            max = cur;
        }
        last = i;
        if (first == -1) {
            first = i;
        }
        cur = 0;
    }
}

if (max < first + 1439 - last) {
    max = first + 1439 - last;
}

print(("0" + Math.floor(max / 60)).slice(-2) + ":" + ("0" + max % 60).slice(-2));


function compareNumeric(a, b) {
  return a - b;
}

var n = readline();

var mas = [];
for(i = 0; i < n; i++){
    var login = readline();
    var k = login[0] * 10 + login[1] * 1;
    k = k * 60;
    k = k * 1 + login[3] * 10 + login[4] * 1;
    mas.push(k);
}
mas.sort(compareNumeric);
var ans = 0;
for(i = 0; i < n-1; i++){
    ans = Math.max(mas[i+1] - mas[i] - 1, ans);
}
ans = Math.max(ans, (23*60+59 - mas[n-1]) + mas[0] * 1);
print((Math.floor(ans / 60)) + ":" + (ans - Math.floor(ans / 60) * 60));


function compareNumeric(a, b) {
  return a - b;
}

var n = readline();

var mas = [];
for(i = 0; i < n; i++){
    var login = readline();
    var k = login[0] * 10 + login[1] * 1;
    k = k * 60;
    k = k * 1 + login[3] * 10 + login[4] * 1;
    mas.push(k);
}
mas.sort(compareNumeric);
var ans = 0;
for(i = 0; i < n-1; i++){
    ans = Math.max(mas[i+1] - mas[i] - 1, ans);
}
ans = Math.max(ans, (23*60+59 - mas[n-1]) + mas[0] * 1);
var k1 = (Math.floor(ans / 60));
var k2 = ans - k1 * 60;
if(k1 < 10) k1 = '0' + k1;
if(k2 < 10) k2 = '0'+ k2;
print(k1 + ":" + k2);


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

public class A {
	static StreamTokenizer st;
	public static void main(String[] args) throws  IOException{
		st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		int n = nextInt();
		int d = nextInt();
		long []a = new long [n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt();
		}
		long ans = 0;
		for (int i = 1; i < a.length; i++) {
			while (a[i-1] >= a[i]){
				a[i] += d;
				ans++;
			}
		}
		System.out.println(ans);
	}
	private static int nextInt() throws IOException{
		st.nextToken();
		return (int) st.nval;
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

public class A {
	static StreamTokenizer st;
	public static void main(String[] args) throws  IOException{
		st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		int n = nextInt();
		int d = nextInt();
		long []a = new long [n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt();
		}
		long ans = 0;
		for (int i = 1; i < a.length; i++) {
			if (a[i-1] >= a[i]){
				long x = (a[i-1]-a[i])/d;
				if ((a[i-1]-a[i])%d != 0){
					x++;
				}
				if (a[i-1] == a[i]) x++;
				a[i] = a[i]+(long)x*d;
				ans += (long)x;
			}
		}
		System.out.println(ans);
	}
	private static int nextInt() throws IOException{
		st.nextToken();
		return (int) st.nval;
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

public class A {
	static StreamTokenizer st;

	public static void main(String[] args) throws IOException {
		st = new StreamTokenizer(new BufferedReader(new InputStreamReader(
				System.in)));
		int n = nextInt();
		int d = nextInt();
		long[] a = new long[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt();
		}
		long ans = 0;
		for (int i = 1; i < a.length; i++) {
			long x = 0;
			if (a[i - 1] > a[i]) {
				x = (a[i - 1] - a[i]) / d + 1;
			} else {
				if (a[i] == a[i - 1]) {
					x++;
				}
			}
			a[i] += x * d;
			ans += x;
		}
		System.out.println(ans);
	}

	private static int nextInt() throws IOException {
		st.nextToken();
		return (int) st.nval;
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

public class A {
	static StreamTokenizer st;
	public static void main(String[] args) throws  IOException{
		st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		int n = nextInt();
		int d = nextInt();
		long []a = new long [n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt();
		}
		long ans = 0;
		for (int i = 1; i < a.length; i++) {
			if (a[i-1] >= a[i]){
				long x = (a[i-1]-a[i])/d;
				if ((a[i-1]-a[i])%d != 0){
					x++;
				}
				if (a[i-1] == a[i]) x++;
				a[i] = a[i]+x*d;
				ans += x;
			}
		}
		System.out.println(ans);
	}
	private static int nextInt() throws IOException{
		st.nextToken();
		return (int) st.nval;
	}

}


import java.util.Scanner;

/**
 * @author Son-Huy TRAN
 *
 */
public class P11A_IncreasingSequence {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int d = scanner.nextInt();
		int[] numbers = new int[n];

		for (int i = 0; i < n; i++) {
			numbers[i] = scanner.nextInt();
		}

		scanner.close();

		int stepCount = 0;

		for (int i = 1; i < n; i++) {
			if (numbers[i] > numbers[i - 1]) {
				continue;
			}

			int current = numbers[i];
			int min = numbers[i - 1] + 1;
			int step = (int) Math.ceil((min - current) * 1.0 / d);
			stepCount += step;

			numbers[i] = current + step * d;
		}

		System.out.println(stepCount);
	}
}


import java.util.*;

public class Sequence{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		// Read input
		int n = scan.nextInt();
		int d = scan.nextInt();

		long[] b = new long[n];
		for(int i = 0; i < n; i++) b[i] = scan.nextLong();

		// Count optimal moves needed
		int m = 0;

		for(int i = 1; i < n; i++){
			long diff = b[i - 1] - b[i];
			if(diff >= 0){
				if(diff == 0){
					m += 1;
					b[i] += d;
				}else{
					int k = (int) Math.ceil((float) diff / d);
					m += k;
					b[i] += d * k;
				}
			}
		}
		System.out.println(m);
	}
}


import java.util.*;

public class Sequence{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		// Read input
		int n = scan.nextInt();
		int d = scan.nextInt();

		long[] b = new long[n];
		for(int i = 0; i < n; i++) b[i] = scan.nextLong();

		// Count optimal moves needed
		int m = 0;

		for(int i = 1; i < n; i++){
			while(b[i] <= b[i - 1]){
				b[i] += d;
				m += 1;
			}
		}
		System.out.println(m);
	}
}


import java.util.*;

public class Sequence{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		// Read input
		int n = scan.nextInt();
		int d = scan.nextInt();

		long[] b = new long[n];
		for(int i = 0; i < n; i++) b[i] = scan.nextLong();

		// Count optimal moves needed
		int m = 0;

		/*for(int i = 1; i < n; i++){
			long diff = b[i - 1] - b[i];
			if(diff >= 0){
				if(diff == 0){
					m += 1;
					b[i] += d;
				}else{
					int k = (int) Math.ceil((float) diff / d);
					m += k;
					b[i] += d * k;
				}
			}
		}*/
		/*for(int i = 1; i < n; i++){
			while(b[i] <= b[i - 1]){
				b[i] += d;
				m += 1;
			}
		}*/
		for(int i = 1; i < n; i++){
			long diff = b[i - 1] - b[i];
			if(diff == 0){
				m += 1;
				b[i] += d;
			}else if(diff > 0){
				long k = (long) Math.ceil((float) diff/ (float) d);
				m += k;
				b[i] += (d*k);
			}
		}
		System.out.println(m);
	}
}


import java.util.*;

public class Sequence{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		// Read input
		int n = scan.nextInt();
		int d = scan.nextInt();

		long[] b = new long[n];
		for(int i = 0; i < n; i++) b[i] = scan.nextLong();

		// Count optimal moves needed
		int m = 0;

		/*for(int i = 1; i < n; i++){
			long diff = b[i - 1] - b[i];
			if(diff >= 0){
				if(diff == 0){
					m += 1;
					b[i] += d;
				}else{
					int k = (int) Math.ceil((float) diff / d);
					m += k;
					b[i] += d * k;
				}
			}
		}*/
		/*for(int i = 1; i < n; i++){
			while(b[i] <= b[i - 1]){
				b[i] += d;
				m += 1;
			}
		}*/
		for(int i = 1; i < n; i++){
			long diff = b[i - 1] - b[i];
			if(diff == 0){
				m += 1;
				b[i] += d;
			}else if(diff > 0){
				long k = (long) diff / d;
				m += k;
				b[i] += (d * k);
				if(b[i] <= b[i - 1]){
					m += 1;
					b[i] += d;
				}
			}
		}
		System.out.println(m);
	}
}


import java.util.*;

public class Sequence{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		// Read input
		int n = scan.nextInt();
		int d = scan.nextInt();

		int[] b = new int[n];
		for(int i = 0; i < n; i++) b[i] = scan.nextInt();

		// Count optimal moves needed
		int m = 0;

		for(int i = 1; i < n; i++){
			int diff = b[i - 1] - b[i];
			if(diff >= 0){
				if(diff == 0){
					m += 1;
					b[i] += d;
				}else{
					int k = (int) Math.ceil((float) diff / d);
					m += k;
					b[i] += d * k;
				}
			}
		}
		System.out.println(m);
	}
}


import java.util.*;

public class Sequence{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		// Read input
		int n = scan.nextInt();
		int d = scan.nextInt();

		int[] b = new int[n];
		for(int i = 0; i < n; i++) b[i] = scan.nextInt();

		// Count optimal moves needed
		long m = 0;

		for(int i = 1; i < n; i++){
			int diff = b[i - 1] - b[i];
			if(diff >= 0){
				if(diff == 0){
					m += 1;
					b[i] += d;
				}else{
					int k = (int) Math.ceil((float) diff / d);
					m += k;
					b[i] += d * k;
				}
			}
		}
		System.out.println(m);
	}
}


import java.io.*;
import java.util.*;

public class Main {

    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer st;

    static int binSearch(long a, long b, long d){
        int left = 0;
        int right = 1000000;
        while(right - left > 1){
            int mid = (left + right) / 2;
            if(a >= b + d * mid){
                left = mid;
            }else{
                right = mid;
            }
        }
        return right;
    }

    static void solve() throws Exception {
        int n = nextInt();
        long d = nextInt();
        int[] b = new int[n];
        for(int i = 0; i < n; i++){
            b[i] = nextInt();
        }
        int cnt = 0;
        for(int i = 1; i < n; i++){
            if(b[i - 1] >= b[i]){
                int ans = binSearch(b[i - 1], b[i], d);
                b[i] += d * ans;
                cnt += ans;
            }
        }
        out.print(cnt);
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public static void main(String[] args) {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new PrintStream(System.out));
            solve();
            out.close();
            br.close();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

}


import java.io.*;
import java.util.*;

public class Main {

    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer st;

    static void solve() throws Exception {
        int n = nextInt();
        int d = nextInt();
        int[] b = new int[n];
        for(int i = 0; i < n; i++){
            b[i] = nextInt();
        }
        int cnt = 0;
        for(int i = 1; i < n; i++){
            while(b[i - 1] >= b[i]){
                b[i] += d;
                cnt++;
            }
        }
        out.print(cnt);
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public static void main(String[] args) {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new PrintStream(System.out));
            solve();
            out.close();
            br.close();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

}


import java.io.*;
import java.util.*;

public class Main {

    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer st;

    static int binSearch(long a, long b, long d){
        int left = 0;
        int right = 1000000;
        while(right - left > 1){
            int mid = (left + right) / 2;
            if(a >= b + d * mid){
                left = mid;
            }else{
                right = mid;
            }
        }
        return right;
    }

    static void solve() throws Exception {
        int n = nextInt();
        long d = nextInt();
        long[] b = new long[n];
        for(int i = 0; i < n; i++){
            b[i] = nextInt();
        }
        int cnt = 0;
        for(int i = 1; i < n; i++){
            if(b[i - 1] >= b[i]){
                int ans = binSearch(b[i - 1], b[i], d);
                b[i] += d * ans;
                cnt += ans;
            }
        }
        out.print(cnt);
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public static void main(String[] args) {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new PrintStream(System.out));
            solve();
            out.close();
            br.close();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

}


import java.io.*;
import java.util.*;

public class Main {

    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer st;

    static void solve() throws Exception {
        int n = nextInt();
        int d = nextInt();
        int[] b = new int[n];
        for(int i = 0; i < n; i++){
            b[i] = nextInt();
        }
        int cnt = 0;
        for(int i = 1; i < n; i++){
            if(b[i - 1] >= b[i]){
                int diff = Math.max(b[i - 1] - b[i],1);
                int c = (diff + (d - 1))/d;
                b[i] += d * c;
                cnt += c;
            }
        }
        out.print(cnt);
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public static void main(String[] args) {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new PrintStream(System.out));
            solve();
            out.close();
            br.close();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

}


import java.io.*;
import java.util.*;

public class Main {

    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer st;

    static int binSearch(long a, long b, long d){
        int left = 0;
        int right = 10000000;
        while(right - left > 1){
            int mid = (left + right) / 2;
            if(a >= b + d * mid){
                left = mid;
            }else{
                right = mid;
            }
        }
        return right;
    }

    static void solve() throws Exception {
        int n = nextInt();
        long d = nextInt();
        long[] b = new long[n];
        for(int i = 0; i < n; i++){
            b[i] = nextInt();
        }
        int cnt = 0;
        for(int i = 1; i < n; i++){
            if(b[i - 1] >= b[i]){
                int ans = binSearch(b[i - 1], b[i], d);
                b[i] += d * ans;
                cnt += ans;
            }
        }
        out.print(cnt);
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public static void main(String[] args) {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new PrintStream(System.out));
            solve();
            out.close();
            br.close();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Iterator;
import java.util.StringTokenizer;

/**
 * @author artyom
 */
public class IncreasingSequence implements Runnable {
    private BufferedReader in;
    private PrintStream out;
    private StringTokenizer tok;

    private void solve() throws IOException {
        int n = nextInt(), d = nextInt();
		int steps = 0, prev = nextInt();
		for (int i = 1; i < n; i++) {
			int cur = nextInt();
			if (cur <= prev) {
				int diff = 1 + (prev - cur) / d;
				steps += diff;
				prev = cur + d * diff;
			} else {
				prev = cur;
			}
		}
		out.println(steps);
	}

    //--------------------------------------------------------------
    public static void main(String[] args) {
        new IncreasingSequence().run();
    }

    @Override
    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = System.out;
            tok = null;
            solve();
            in.close();
        } catch (IOException e) {
            System.exit(0);
        }
    }

    private int[] readArray(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        return arr;
    }

    private static String join(Iterable<?> entries, CharSequence separator) {
        StringBuilder sb = new StringBuilder();
        for (Iterator<?> iterator = entries.iterator(); iterator.hasNext();) {
            sb.append(iterator.next());
            if (iterator.hasNext()) {
                sb.append(separator);
            }
        }
        return sb.toString();
    }

	private static String join(int[] entries, CharSequence separator) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0, n = entries.length - 1; i <= n; i ++) {
			sb.append(entries[i]);
			if (i < n) {
				sb.append(separator);
			}
		}
		return sb.toString();
	}

    private String nextToken() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    private short nextShort() throws IOException {
        return Short.parseShort(nextToken());
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
}


import java.util.*;
import java.io.*;

public class Task {

	static Scanner in;
	static PrintWriter out;

	void solve() {
		int n = in.nextInt(), d = in.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; ++i)
			a[i] = in.nextInt();
		int ans = 0;
		for (int i = 1; i < n; ++i)
			if (a[i] <= a[i - 1]) {
				ans += (a[i - 1] - a[i]) / d + 1;
				a[i] += ((a[i - 1] - a[i]) / d + 1) * d;
			}
		out.println(ans);
	}

	void run() {
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) {
		new Task().run();
	}

}


import java.io.*;
import java.util.*;
import java.math.*;

public class Main {
	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	static void solve() throws Exception {
		int n = nextInt();
		int d = nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		int res = 0;
		for (int i = 1; i < n; i++) {
			if (a[i] <= a[i-1]) {
				if ((a[i-1]-a[i]+1) % d == 0) {
					res += (a[i-1]-a[i]+1) / d;
					a[i] += (a[i-1]-a[i]+1);
				} else {
					res += (a[i-1]-a[i]+1) / d + 1;
					a[i] += ((a[i-1]-a[i]+1) / d + 1) * d;
				}
			}
		}
		out.println(res);
	}

	static int sqr(int x) {
		return x*x;
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	static BigInteger nextBigInteger() throws IOException {
		return new BigInteger(next());
	}

	static String next() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	static String nextLine() throws IOException {
		tok = new StringTokenizer("");
		return in.readLine();
	}

	static boolean hasNext() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null) {
				return false;
			}
			tok = new StringTokenizer(s);
		}
		return true;
	}

	public static void main(String args[]) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			//in = new BufferedReader(new FileReader("bridges.in"));
			//out = new PrintWriter(new FileWriter("bridges.out"));
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			java.lang.System.exit(1);
		}
	}
}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){
		  int dif = a[i] - a[i + 1];
		  if(a[i] >= a[i + 1]){

			  if(dif == 0 || dif % d != 0){
				  ans++;
				  a[i + 1] += d;
			  }
			  a[i + 1] += (dif / d) * d;
			  ans += dif / d;
		  }

	  }

	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){

		  if(a[i] >= a[i + 1]){
			  ans += (a[i] - a[i + 1]) / d + 1;
			  a[i + 1] += ((a[i] - a[i + 1]) / d + 1) * d;
		  }
	  }

	  /*for(int i = 1; i <= n; i++){
		  out.print(a[i] + " ");
		  }*/
	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){

		  if(a[i] >= a[i + 1]){
			 int dif = a[i] - a[i + 1];
			  ans += dif / d + 1;
			  a[i + 1] += (dif / d + 1) * d;
		  }

	  }

	  /*for(int i = 1; i <= n; i++){
		  out.print(a[i] + " ");
		  }*/
	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){

		  if(a[i] >= a[i + 1]){
			 int dif = a[i] - a[i + 1];
			if( dif % d !=0 || dif < 3){
				ans++;
				a[i + 1] += d;
			}
			ans += dif / d;
			a[i + 1] += ((dif / d) * d);
		  }

	  }

	  /*for(int i = 1; i <= n; i++){
		  out.print(a[i] + " ");
		  }*/
	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){
		  int dif = a[i] - a[i + 1];
		  if(a[i] >= a[i + 1]){

			  if( dif <= 0 || dif % d != 0){
				  ans++;
				  a[i + 1] += d;
			  }
			  a[i + 1] += (dif / d) * d;
			  ans += dif / d;
		  }

	  }

	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[1000];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){
		  if(a[i] >= a[i + 1]){
			  while(a[i] >= a[i + 1]){
				  a[i + 1] += d; ans++;
			  }
		  }
	  }

	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){
		  if(a[i] >= a[i + 1]){
			  while(a[i] >= a[i + 1]){
				  a[i + 1] += d; ans++;
			  }
		  }
	  }

	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){

		  if(a[i] >= a[i + 1]){
			 int dif = a[i] - a[i + 1];
			if( dif % d !=0 || dif < 3){
				ans++;
				a[i + 1] += d;
			}
			ans += dif / d;
			a[i + 1] += ((dif / d) * d);
			if(a[i] == a[i + 1])a[i + 1] += d;
		  }

	  }

	  /*for(int i = 1; i <= n; i++){
		  out.print(a[i] + " ");
		  }*/
	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


// package main;
import java.io.*;
import java.math.*;
import   java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
  public static void main(String[] args) {
      InputStream inputStream = System.in;
      OutputStream outputStream = System.out;
      FastScanner scan = new FastScanner(inputStream);
      FastPrinter out = new FastPrinter(outputStream);
      TaskD solver = new TaskD();
      solver.solve(1, scan, out);
      out.close();
  }
}

class TaskD {

   static boolean f(String s, String a, String b){
	   if(s.indexOf(a) != -1 && s.indexOf(b , s.indexOf(a) + a.length()) != -1){
		   return true;
	   }

	   return false;
   }

  static int gcd(int m, int n){
	  if(m < n)return gcd(n, m);
	  else if(m % n == 0)return n;
	  else return gcd(n, m % n);
  }
  public void solve(int testNumber, FastScanner scan, FastPrinter out) {

	 int n = scan.nextInt(), d = scan.nextInt();
	 int[] a = new int[2001];

	 for(int i =1; i <= n; i++){
		 a[i] = scan.nextInt();
	 }
	 int ans = 0;
	  for(int i = 1; i <= n - 1; i++){

		  if(a[i] >= a[i + 1]){
			  int dif = a[i] - a[i + 1];
			  if( dif < d || dif % d != 0){
				  ans++;
				  a[i + 1] += d;
			  }
			  a[i + 1] += (dif / d) * d;
			  ans += dif / d;
		  }

	  }

	  out.println(ans);
}
}

class FastScanner extends BufferedReader {

  public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
  }

  public int read() {
      try {
          int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
          return ret;
      } catch (IOException e) {
          throw new InputMismatchException();
      }
  }

  public String next() {
      StringBuilder sb = new StringBuilder();
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      if (c < 0) {
          return null;
      }
      while (c >= 0 && !isWhiteSpace(c)) {
          sb.appendCodePoint(c);
          c = read();
      }
      return sb.toString();
  }

  static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
  }

  public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
          c = read();
      }
      int sgn = 1;
      if (c == '-') {
          sgn = -1;
          c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
          if (c < '0' || c > '9') {
              throw new NumberFormatException("digit expected " + (char) c
                      + " found");
          }
          ret = ret * 10 + c - '0';
          c = read();
      }
      return ret * sgn;
  }

  public long nextLong() {
      return Long.parseLong(next());
  }

  public String readLine() {
      try {
          return super.readLine();
      } catch (IOException e) {
          return null;
      }
  }

  }

class FastPrinter extends PrintWriter {

  public FastPrinter(OutputStream out) {
      super(out);
  }

  public FastPrinter(Writer out) {
      super(out);
  }

}


import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.*;
public class IncreasingSequence
{
    static final int INF = Integer.MAX_VALUE;
    static final int NINF = Integer.MIN_VALUE;

    public static void main(String[]args)throws IOException
    {
        Input in = new Input();
        int n = in.nextInt();
        int d = in.nextInt();
        int [] arr = new int[n];
        for(int i = 0; i < n; i++)
            arr[i] = in.nextInt();
        int res = 0;
        for(int i = 1; i < n; i++)
        {
            while(arr[i] <= arr[i-1])
            {
                //int x = arr[i-1]-arr[i];
                res++;
                arr[i] += d;
            }
        }
        System.out.println(res);
    }
    public static void exit()
    {
        System.exit(0);
    }
}

class Input
{
    BufferedReader br;
    StringTokenizer st;

    public Input()
    {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public String nextLine()throws IOException
    {
        StringBuilder sb = new StringBuilder();
        if(st == null)
            st = new StringTokenizer(br.readLine());
        if(!st.hasMoreTokens())
        {
            st = new StringTokenizer(br.readLine());
            return "";
        }

        while(st.hasMoreTokens())
        {
            sb = sb.append(st.nextToken());
            if(st.hasMoreTokens())
              sb = sb.append(" ");
        }
        st = new StringTokenizer(br.readLine());
        return sb.toString();
    }

    public int nextInt()throws IOException
    {
        return Integer.parseInt(next());
    }

    public long nextLong()throws IOException
    {
        return Long.parseLong(next());
    }

    public float nextFloat()throws IOException
    {
        return Float.parseFloat(next());
    }

    public double nextDouble()throws IOException
    {
        return Double.parseDouble(next());
    }

    public String next()throws IOException
    {
        if(st == null || !st.hasMoreTokens())
          st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}


import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.*;
public class IncreasingSequence
{
    static final int INF = Integer.MAX_VALUE;
    static final int NINF = Integer.MIN_VALUE;

    public static void main(String[]args)throws IOException
    {
        Input in = new Input();
        int n = in.nextInt();
        int d = in.nextInt();
        int [] arr = new int[n];
        for(int i = 0; i < n; i++)
            arr[i] = in.nextInt();
        int res = 0;
        for(int i = 1; i < n; i++)
        {
            if(arr[i] <= arr[i-1])
            {
                int x = arr[i-1]-arr[i];
                if(x < d)
                {
                    arr[i] += d;
                    res++;
                }else
                {
                    arr[i] += (x/d + 1)*d;
                    res += (x/d + 1);
                }
            }
        }
        System.out.println(Arrays.toString(arr));
        System.out.println(res);
    }
    public static void exit()
    {
        System.exit(0);
    }
}

class Input
{
    BufferedReader br;
    StringTokenizer st;

    public Input()
    {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public String nextLine()throws IOException
    {
        StringBuilder sb = new StringBuilder();
        if(st == null)
            st = new StringTokenizer(br.readLine());
        if(!st.hasMoreTokens())
        {
            st = new StringTokenizer(br.readLine());
            return "";
        }

        while(st.hasMoreTokens())
        {
            sb = sb.append(st.nextToken());
            if(st.hasMoreTokens())
              sb = sb.append(" ");
        }
        st = new StringTokenizer(br.readLine());
        return sb.toString();
    }

    public int nextInt()throws IOException
    {
        return Integer.parseInt(next());
    }

    public long nextLong()throws IOException
    {
        return Long.parseLong(next());
    }

    public float nextFloat()throws IOException
    {
        return Float.parseFloat(next());
    }

    public double nextDouble()throws IOException
    {
        return Double.parseDouble(next());
    }

    public String next()throws IOException
    {
        if(st == null || !st.hasMoreTokens())
          st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}


import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.*;
public class IncreasingSequence
{
    static final int INF = Integer.MAX_VALUE;
    static final int NINF = Integer.MIN_VALUE;

    public static void main(String[]args)throws IOException
    {
        Input in = new Input();
        int n = in.nextInt();
        int d = in.nextInt();
        int [] arr = new int[n];
        for(int i = 0; i < n; i++)
            arr[i] = in.nextInt();
        int res = 0;
        for(int i = 1; i < n; i++)
        {
            if(arr[i] <= arr[i-1])
            {
                int x = arr[i-1]-arr[i];
                if(x < d)
                {
                    arr[i] += d;
                    res++;
                }else
                {
                    arr[i] += (x/d + 1)*d;
                    res += (x/d + 1);
                }
            }
        }
        //System.out.println(Arrays.toString(arr));
        System.out.println(res);
    }
    public static void exit()
    {
        System.exit(0);
    }
}

class Input
{
    BufferedReader br;
    StringTokenizer st;

    public Input()
    {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public String nextLine()throws IOException
    {
        StringBuilder sb = new StringBuilder();
        if(st == null)
            st = new StringTokenizer(br.readLine());
        if(!st.hasMoreTokens())
        {
            st = new StringTokenizer(br.readLine());
            return "";
        }

        while(st.hasMoreTokens())
        {
            sb = sb.append(st.nextToken());
            if(st.hasMoreTokens())
              sb = sb.append(" ");
        }
        st = new StringTokenizer(br.readLine());
        return sb.toString();
    }

    public int nextInt()throws IOException
    {
        return Integer.parseInt(next());
    }

    public long nextLong()throws IOException
    {
        return Long.parseLong(next());
    }

    public float nextFloat()throws IOException
    {
        return Float.parseFloat(next());
    }

    public double nextDouble()throws IOException
    {
        return Double.parseDouble(next());
    }

    public String next()throws IOException
    {
        if(st == null || !st.hasMoreTokens())
          st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}


import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.*;
public class IncreasingSequence
{
    static final int INF = Integer.MAX_VALUE;
    static final int NINF = Integer.MIN_VALUE;

    public static void main(String[]args)throws IOException
    {
        Input in = new Input();
        int n = in.nextInt();
        int d = in.nextInt();
        int [] arr = new int[n];
        for(int i = 0; i < n; i++)
            arr[i] = in.nextInt();
        int res = 0;
        for(int i = 1; i < n; i++)
        {
            if(arr[i] <= arr[i-1])
            {
                int x = arr[i-1]-arr[i];
                if(x == 0)
                {
                    arr[i] += d*((x+d)/d);
                    res += (x+d)/d;
                }
                else
                {
                    arr[i] += d*((x+d-1)/d);
                    res += (x+d-1)/d;
                }
            }
        }
        //System.out.println(Arrays.toString(arr));
        System.out.println(res);
    }
    public static void exit()
    {
        System.exit(0);
    }
}

class Input
{
    BufferedReader br;
    StringTokenizer st;

    public Input()
    {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public String nextLine()throws IOException
    {
        StringBuilder sb = new StringBuilder();
        if(st == null)
            st = new StringTokenizer(br.readLine());
        if(!st.hasMoreTokens())
        {
            st = new StringTokenizer(br.readLine());
            return "";
        }

        while(st.hasMoreTokens())
        {
            sb = sb.append(st.nextToken());
            if(st.hasMoreTokens())
              sb = sb.append(" ");
        }
        st = new StringTokenizer(br.readLine());
        return sb.toString();
    }

    public int nextInt()throws IOException
    {
        return Integer.parseInt(next());
    }

    public long nextLong()throws IOException
    {
        return Long.parseLong(next());
    }

    public float nextFloat()throws IOException
    {
        return Float.parseFloat(next());
    }

    public double nextDouble()throws IOException
    {
        return Double.parseDouble(next());
    }

    public String next()throws IOException
    {
        if(st == null || !st.hasMoreTokens())
          st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;

public class Task {

	private static final boolean readFromFile = false;

	public static void main(String args[]){
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FileOutputStream fileOutputStream;
		FileInputStream fileInputStream;
		if (readFromFile){
			try{
				fileInputStream = new FileInputStream(new File("input.txt"));
				fileOutputStream = new FileOutputStream(new File("output.txt"));
			}catch (FileNotFoundException e){
				throw new RuntimeException(e);
			}
		}
		PrintWriter out = new PrintWriter((readFromFile)?fileOutputStream:outputStream);
		InputReader in = new InputReader((readFromFile)?fileInputStream:inputStream);

		Solver s = new Solver(in,out);
		s.solve();

		out.close();
	}
}

class Solver{
	InputReader in;
	PrintWriter out;

	public void solve(){
		int n=in.nextInt(),
				d=in.nextInt(),
				a[] = new int[n];
		for (int i=0;i<n;i++)
			a[i]=in.nextInt();
		int ans=0;
		for (int i=1;i<n;i++){
			if (a[i]<=a[i-1]){
				int razn = a[i-1]-a[i];
				razn = razn/d;
				a[i]=a[i]+razn*d;
				ans += razn;
				if (a[i]<=a[i-1]){
					ans++;
					a[i]+=d;
				}
			}
		}
		out.println(ans);
	}

	Solver(InputReader in, PrintWriter out){
		this.in=in;
		this.out=out;
	}
}

class InputReader{
	private BufferedReader buf;
	private StringTokenizer tok;

	InputReader(InputStream in){
		tok = null;
		buf = new BufferedReader(new InputStreamReader(in));
	}

	InputReader(FileInputStream in){
		tok = null;
		buf = new BufferedReader(new InputStreamReader(in));
	}

	public String next(){
		while (tok==null || !tok.hasMoreTokens()){
			try{
				tok = new StringTokenizer(buf.readLine());
			}catch (IOException e){
				throw new RuntimeException(e);
			}
		}
		return tok.nextToken();
	}

	public int nextInt(){
		return Integer.parseInt(next());
	}

	public long nextLong(){
		return Long.parseLong(next());
	}

	public double nextDouble(){
		return Double.parseDouble(next());
	}

	public float nextFloat(){
		return Float.parseFloat(next());
	}

	public String nextLine(){
		try{
			return buf.readLine();
		}catch (IOException e){
			return null;
		}
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;

public class Task {

	private static final boolean readFromFile = false;

	public static void main(String args[]){
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FileOutputStream fileOutputStream;
		FileInputStream fileInputStream;
		if (readFromFile){
			try{
				fileInputStream = new FileInputStream(new File("input.txt"));
				fileOutputStream = new FileOutputStream(new File("output.txt"));
			}catch (FileNotFoundException e){
				throw new RuntimeException(e);
			}
		}
		PrintWriter out = new PrintWriter((readFromFile)?fileOutputStream:outputStream);
		InputReader in = new InputReader((readFromFile)?fileInputStream:inputStream);

		Solver s = new Solver(in,out);
		s.solve();

		out.close();
	}
}

class Solver{
	InputReader in;
	PrintWriter out;

	public void solve(){
		int n=in.nextInt(),
				d=in.nextInt(),
				a[] = new int[n];
		for (int i=0;i<n;i++)
			a[i]=in.nextInt();
		int ans=0;
		for (int i=1;i<n;i++)
			while (a[i]<=a[i-1]){
				ans++;
				a[i]+=d;
			}
		out.println(ans);
	}

	Solver(InputReader in, PrintWriter out){
		this.in=in;
		this.out=out;
	}
}

class InputReader{
	private BufferedReader buf;
	private StringTokenizer tok;

	InputReader(InputStream in){
		tok = null;
		buf = new BufferedReader(new InputStreamReader(in));
	}

	InputReader(FileInputStream in){
		tok = null;
		buf = new BufferedReader(new InputStreamReader(in));
	}

	public String next(){
		while (tok==null || !tok.hasMoreTokens()){
			try{
				tok = new StringTokenizer(buf.readLine());
			}catch (IOException e){
				throw new RuntimeException(e);
			}
		}
		return tok.nextToken();
	}

	public int nextInt(){
		return Integer.parseInt(next());
	}

	public long nextLong(){
		return Long.parseLong(next());
	}

	public double nextDouble(){
		return Double.parseDouble(next());
	}

	public float nextFloat(){
		return Float.parseFloat(next());
	}

	public String nextLine(){
		try{
			return buf.readLine();
		}catch (IOException e){
			return null;
		}
	}
}


import java.util.Scanner;

public class IncreasingSequence {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d = in.nextInt();

		int a = 0, moves = 0;
		for (int i = 0; i < n; i++)	 {

			int b = in.nextInt();

			while (b <= a) {
				b += d;
				moves++;
			}

			a = b;
		}
		in.close();

		System.out.println(moves);
	}

}