In a strategic computer game "Settlers II" one has to build defense structures to expand and protect the territory. Let's take one of these buildings. At the moment the defense structure accommodates exactly n soldiers. Within this task we can assume that the number of soldiers in the defense structure won't either increase or decrease.

Every soldier has a rank — some natural number from 1 to k. 1 stands for a private and k stands for a general. The higher the rank of the soldier is, the better he fights. Therefore, the player profits from having the soldiers of the highest possible rank.

To increase the ranks of soldiers they need to train. But the soldiers won't train for free, and each training session requires one golden coin. On each training session all the n soldiers are present.

At the end of each training session the soldiers' ranks increase as follows. First all the soldiers are divided into groups with the same rank, so that the least possible number of groups is formed. Then, within each of the groups where the soldiers below the rank k are present, exactly one soldier increases his rank by one.

You know the ranks of all n soldiers at the moment. Determine the number of golden coins that are needed to increase the ranks of all the soldiers to the rank k.

Input

The first line contains two integers n and k (1 ≤ n, k ≤ 100). They represent the number of soldiers and the number of different ranks correspondingly. The second line contains n numbers in the non-decreasing order. The i-th of them, ai, represents the rank of the i-th soldier in the defense building (1 ≤ i ≤ n, 1 ≤ ai ≤ k).

Output

Print a single integer — the number of golden coins needed to raise all the soldiers to the maximal rank.

Examples

Input

4 4
1 2 2 3


Output

4

Input

4 3
1 1 1 1


Output

5

Note

In the first example the ranks will be raised in the following manner:

1 2 2 3 →  2 2 3 4 →  2 3 4 4 →  3 4 4 4 →  4 4 4 4

Thus totals to 4 training sessions that require 4 golden coins.
/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{ 
   static boolean isValid(int a[],int k)
    {
       for(int i=0;i<a.length;i++)
        {
           if(a[i]!=k)
            return false;
        }
      return true;
    }
   
  public static void main (String[] args) throws java.lang.Exception
   {
	try{
	     //long a=Long.parseLong(next());
	    // int a=sc.nextInt();
	     Reader sc=new Reader();
	     PrintWriter out=new PrintWriter(System.out);
		      int n=sc.nextInt();
		      int k=sc.nextInt();
		      int a[]=new int[n];
		      for(int i=0;i<n;i++)
		       a[i]=sc.nextInt();
		      int coin=0;
		      Arrays.sort(a);
		      boolean ar[]=new boolean[n];
		      while(!isValid(a,k))
		        {
		          for(int i=0;i<n-1;i++)
		            {
		               if(a[i]!=a[i+1])
		                a[i]++;
		              if(a[i]==k && !ar[i])
		               ar[i]=true;
		            }
		          if(a[n-1]!=k)
		           a[n-1]++;
		          if(a[n-1]==k)
		           ar[n-1]=true;
		           coin++;
		        }
		      out.println(coin);
		    
	out.flush();
	out.close();
	   }     
	catch(Exception e)
		 {}
	}
	//Template
  // static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   //  static PrintWriter pw = new PrintWriter(System.out);
   //  static StringTokenizer st;
    
   //  static String next()
   //     {
   //          while(st==null || !st.hasMoreElements()) 
   //          {
   //              try
   //              {
   //                 st = new StringTokenizer(br.readLine());
   //              }
   //              catch(IOException e)
   //              {
   //                 e.printStackTrace();
   //              }
   //          }
   //          return st.nextToken();
   //     }
   // static int gcd(int a,int b)
   //  {
   //     if(b==0)
   //     return a;
   //     else
   //     return gcd(b,a%b);
   //  }
   
    static class Reader 
    { 
        final private int BUFFER_SIZE = 1 << 16; 
        private DataInputStream din; 
        private byte[] buffer; 
        private int bufferPointer, bytesRead; 
  
        public Reader() 
        { 
            din = new DataInputStream(System.in); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public Reader(String file_name) throws IOException 
        { 
            din = new DataInputStream(new FileInputStream(file_name)); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public String readLine() throws IOException 
        { 
            byte[] buf = new byte[64]; // line length 
            int cnt = 0, c; 
            while ((c = read()) != -1) 
            { 
                if (c == '\n') 
                    break; 
                buf[cnt++] = (byte) c; 
            } 
            return new String(buf, 0, cnt); 
        } 
  
        public int nextInt() throws IOException 
        { 
            int ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do
            { 
                ret = ret * 10 + c - '0'; 
            }  while ((c = read()) >= '0' && c <= '9'); 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public long nextLong() throws IOException 
        { 
            long ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public double nextDouble() throws IOException 
        { 
            double ret = 0, div = 1; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
  
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
  
            if (c == '.') 
            { 
                while ((c = read()) >= '0' && c <= '9') 
                { 
                    ret += (c - '0') / (div *= 10); 
                } 
            } 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        private void fillBuffer() throws IOException 
        { 
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
            if (bytesRead == -1) 
                buffer[0] = -1; 
        } 
  
        private byte read() throws IOException 
        { 
            if (bufferPointer == bytesRead) 
                fillBuffer(); 
            return buffer[bufferPointer++]; 
        } 
  
        public void close() throws IOException 
        { 
            if (din == null) 
                return; 
            din.close(); 
        } 
    } 

}
