	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.io.PrintWriter;
	import java.util.ArrayList;
	import java.util.Arrays;
	import java.util.Map.Entry;
	import java.util.PriorityQueue;
	import java.util.StringTokenizer;
	import java.util.*;

	   public  class Main {

		/*public static int ispr(int n)
	    	{
	    	//boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) {
	            Prime[i] = true;
	        }

	        // mark non-primes <= n using Sieve of Eratosthenes
	        for (int factor = 2; factor*factor <= n; factor++) {

	            // if factor is prime, then mark multiples of factor as nonprime
	            // suffices to consider mutiples factor, factor+1, ...,  n/factor
	            if (Prime[factor]) {
	                for (int j = factor; factor*j <= n; j++) {
	                    Prime[factor*j] = false;
	                }
	            }
	        }
	        // count primes

	        /*int primes = 0;
	        for (int i = 2; i <= n; i++) {
	            if (isPrime	[i])System.out.println(i);

	        }*/
		// System.out.println("The number of primes <= " + n + " is " + primes);
		//return 0;
		// if(isPrime[n]==true)return 1; else return 0;

		//}

		public static long fact(long x)
		{
			if(x==0)return 1;
			else return x*fact(x-1);
		}

		public static long exp(long x, long n, long M)
		{

			if(n==0) return 1;

			else if(n%2==0) return exp((x*x)%M,n/2,M);
			else return (x*exp((x*x)%M,(n-1)/2,M))%M;

		}

		//fi

		static long fib(long n)
		{
			long F[][] = new long[][]{{1,1},{1,0}};
			if (n == 0)
				return 0;
			power(F, n-1);

			return F[0][0];
		}

		static int mod=1000000007;

		static void multiply(long F[][], long M[][])
		{
			long x =  (((F[0][0]%mod)*(M[0][0]%mod))%mod + ((F[0][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long y =  (((F[0][0]%mod)*(M[0][1]%mod))%mod + ((F[0][1]%mod)*(M[1][1]%mod))%mod)%mod;
			long z =  (((F[1][0]%mod)*(M[0][0]%mod))%mod + ((F[1][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long w =  (((F[1][0]%mod)*(M[0][1]%mod))%mod + ((F[1][1]%mod)*(M[1][1]%mod))%mod)%mod;

			F[0][0] = x;
			F[0][1] = y;
			F[1][0] = z;
			F[1][1] = w;
		}

		/* Optimized version of power() in method 4 */
		static void power(long F[][], long n)
		{
			if( n == 0 || n == 1)
				return;
			long M[][] = new long[][]{{1,1},{1,0}};

			power(F, n/2);
			multiply(F, F);

			if (n%2 != 0)
				multiply(F, M);
		}

		public static int gcd(int a, int b)
		{
			if(b==0)
				return a;
			else return gcd(b,a%b);
		}

		static  class MyScanner {

			BufferedReader br;
			StringTokenizer st;

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

			String next() {
				while (st == null || !st.hasMoreElements()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return st.nextToken();
			}

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

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

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

			String nextLine(){
				String str = "";
				try {
					str = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				return str;
			}

		}

		static MyScanner sc = new  MyScanner();
		static PrintWriter pw = new PrintWriter(System.out, true);

		static void printPath(int parent[], int j)
		{
		    // Base Case : If j is source
		    if (parent[j]==-1)
		        {pw.print(j+" ");return;}

		    printPath(parent, parent[j]);

		    pw.print(j+" ");
		}

		//Main begins here :)
	/*
		public static class Pair{
		    int a;
		    int b;
		    Pair(int p,int q){
		        a=p;
		        b=q;
		    }
		    public boolean equals(Object o) {
		        if (o instanceof Pair) {
		            Pair p = (Pair)o;
		            return p.a == a && p.b == b;
		        }
		        return false;
		    }
		    public int hashCode() {
		        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		    }
		}
		*/

		public static int max1(String st, int k)
		{
			int n1=0;
			int max=Integer.MIN_VALUE;
			int n = st.length();
			if(n==1)
			{
				if(st.charAt(0)=='1')return 1;
				else return 0;
			}

			for(int i=1;i<=k;i++)
			{
				int chp=i-1;

				if(st.charAt(chp)=='1')n1++;

			}
			max=Math.max(max, n1);
		//	if(k>=n)return max;
			int slides=n-k;
			int ptr1=0, ptr2=k-1;

			for(int i=1;i<=slides;i++)
			{
				//pw.println(st.substring(ptr1+i, ptr2+i+1));
				ptr1++; ptr2++;
				if(st.charAt(ptr1-1)=='1')n1--;
				if(st.charAt(ptr2)=='1')n1++;
				//pw.println("m1- "+n1);pw

				if(n1>max)max=n1;
				if(max==k){return k;}
			}

			return max;

		}

		public static String shift(String A)
		{
			char lc = A.charAt(A.length()-1);
			return lc+A.substring(0,A.length()-1);

		}

		static  class Point
		{
			long x,y;

			public Point(long a, long b)
			{
				x=a;
				y=b;
			}

			public int compareTo(Point o) {
				// TODO Auto-generated method stub
				return Long.compare(this.x, o.x);

			}

		}

		static class compx implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.x>b.x)return 1;
				if(a.x<b.x) return -1;

				return 0;
			}
		}

		static class compy implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.y>b.y)return 1;
				if(a.y<b.y) return -1;

				return 0;
			}
		}

		public static int lucky(long y)
		{

			long d = y;
			int flg=0;
			//long nd = (long)Math.floor(Math.log10((double)y));
			//pw.println(nd);
			for(;d>=1;d=d/10)
			{
				long dg = d%10;
				if(dg!=0)flg++;
				if(flg==2)return 0;

			}
			return 1;

		}

		public static int diff(Time n, Time k)
		{

			int hn=n.h,mn=n.m,sn=n.s;
			int hk=k.h,mk=k.m,sk=k.s;

			int tc=0,cs=0,cm=0,ch=0;
			if(sk>sn)
			{
				int o1 = sk-sn;
				int o2 = sn+60-sk;

				if(o1>o2)
				{
					cs=o2;
					mn--;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn-1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn--;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(sk<sn)
			{
				int o1 = sn-sk;
				int o2 = sk+60-sn;

				if(o1>o2)
				{
					cs=o2;
					mn++;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn+1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn++;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(mk>mn)
			{
				int o1 = mk-mn;
				int o2 = mn+60-mk;

				if(o1>o2)
				{
					cm=o2;
					hn--;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn-1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn--;
					}
					else
					{
						cm=o1;
					}
				}
			}

			if(mk<mn)
			{
				int o1 = mn-mk;
				int o2 = mk+60-mn;

				if(o1>o2)
				{
					cm=o2;
					hn++;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn+1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn++;
					}
					else
					{
						cm=o1;
					}
				}
			}

			ch = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
			tc=cs+cm+ch;
			return tc;

			//return 3;
		}

		public static class Time
		{
			int h,m,s;

			public Time(int x, int y, int z)
			{
				h=x; m=y; s=z;

			}

		}

		static class Pair
		{
		    int x;
		    int y;

		    public Pair(int a , int b)
		    {
		        x=a;
		        y=b;
		    }

		}

		static class comp implements Comparator<Pair>
		{

		    @Override

		    public int compare(Pair a ,Pair b)
		    {
		        if(b.x>a.x)return -1;
		        if(b.x<a.x)return 1;
		        return 0;

		    }

		}
		static class compv implements Comparator<Vouch>
		{

		    @Override

		    public int compare(Vouch a ,Vouch b)
		    {
		        if(b.c>a.c)return -1;
		        if(b.c<a.c)return 1;
		        return 0;

		    }

		}

		static class Vouch
		{
		   int l,r, c;

		    public Vouch(int a ,int b, int ci)
		    {
		        l=a;
		        r=b;
		        c=ci;

		    }

		}

		public static int strStr(final String haystack, final String needle) {

			if(needle.equals("")) return -1;
		    if(haystack.equals("")&&needle.equals(""))return -1;

		    String temp="";

		    int hl = haystack.length();
		    int nl = needle.length();
		    if(nl>hl) return -1;
		    int ret=-1;
	        String wind = haystack.substring(0,nl);
	        pw.println(wind);
	        if(wind.equals(needle)) return 0;

	        for(int i=1;i<hl-nl;i++)
	        {
	            wind = wind.substring(1, wind.length());

	            wind = wind+haystack.charAt(i+nl);

	            pw.println(i+" "+wind);
	            if(wind.equals(needle))
	            {
	                ret=i; break;
	            }

	        }

	        return (ret==-1)?-1:ret;

			}

		public static int diff(String a, String b)
		{
			int ret=0;
			for(int i=0;i<a.length();i++)
			{
				if(a.charAt(i)!=b.charAt(i))ret++;
			}
			return ret;
		}

		public static boolean inter(Vouch a, Vouch b)
		{
			//return true if there's intersection
			int s1 = a.l;
			int e1 = a.r;

			int s2 = b.l;
			int e2 = b.r;

			if(s1<s2)
			{
				if(e1>=s2)return true;
				else return false;
			}
			else if(s1>s2)
			{
				if(e2>=s1) return true;
				else return false;
			}
			else
			{
				return true;
			}

		}

		static class Com implements Comparator<Range>
		{
		    public int compare(Range a, Range b)
		    {
		         int ac=a.x; int bc=b.x;
		         if(ac>bc)return 1;
		          if(ac<bc)return -1;
		          return 0;

		    }

		}
		static class Range
		{
		    int x,y,z;

		    public Range(int a, int b,int c)
		    {
		        x=a;
		        y=b;
		        z=c;
		    }

		}

		//static ArrayList<Integer> pr;
		public static void main(String[] args) {

          int n = sc.nextInt();
          int k = sc.nextInt();

          int arr[] = new int[n];

          for(int i=0;i<n;i++)arr[i]=sc.nextInt();

          Arrays.sort(arr);

          int max=arr[n-1];
          int req = max/2;
          int ans=0;
          int curr=2*k;
          for(int i=0;i<n&&curr<max;i++)
          {
               int ai = arr[i];
               if(ai<=curr)
               {

                    curr=Math.max(curr,2*ai);

               }else
               {
                   curr=2*(ai-1);
                   ans++;
               }

          }
          pw.println(ans);

          	/*
	     String st = sc.nextLine();

	     Stack<Character> stk = new Stack<Character>();
	     stk.push(st.charAt(0));
	     for(int i=1;i<st.length();i++)
	     {

	                    char cc = st.charAt(i);

	                    if(stk.isEmpty())
	                    {
	                       stk.push(cc);
	                    }
	               else
	               {

	                    if(cc=='('||cc=='{'||cc=='[') stk.push(cc);

	                    char pr = stk.peek();
	                    if(cc==')')
	                    {
	                         if(pr=='(')stk.pop();
	                         else stk.push(cc);

	                    }

	          if(cc=='}')
	                    {
	                         if(pr=='{')stk.pop();
	                         else stk.push(cc);

	                    }

	                     if(cc==']')
	                    {
	                         if(pr=='[')stk.pop();
	                         else stk.push(cc);

	                    }
	               }

	     }
	     if(stk.isEmpty())pw.println("B");
	     else pw.println("NB");

	     while(!stk.isEmpty())pw.println(stk.pop());
	     */

		/*
		int[] D = {4, 7, 4, 8, 4, 1};
        int[] arr = {2,4,5,5,6,9,11,11,13};

        int l=0;
        int r =arr.length-1;
        int sr=12;
        int mid=0;
        int flg=0;
        while(l<=r)
        {
             mid=(l+r)/2;
             if(arr[mid]>sr)r=mid-1;
              if(arr[mid]<sr)l=mid+1;
               if(arr[mid]==sr)
               {
                    flg=1;
                    break;
               }

        }
       */
        //pw.println(l+" "+r);

        /*
          int[] ar= {2,1,5,3,4,8,7};
          Stack<Integer> st =new  Stack<Integer>();

          for(int i=0;i<ar.length-1;i++)
          {
               if(st.isEmpty())
               {
                   st.push(ar[i]);

               }
               else
               {
                    while(!st.isEmpty()&&st.peek()<ar[i])
                    {
                         int g=st.pop();
                         pw.println(g+"--< "+ar[i]);
                       if(ar[i]==8)
                       {
                            pw.println(g);
                       }
                    }
                    st.push(ar[i]);

               }

          }

        while(!st.isEmpty())
        {
            pw.println(st.pop()+"--< -1");

        }
        */
       /* int x,y;
        x=sc.nextInt();
        y=sc.nextInt();

        int[][] arr = new int[x][y];

        for(int i=0;i<x;i++)
        {
             for(int j=0;j<y;j++)
             {
                  arr[i][j]=sc.nextInt();
             }
        }

        PriorityQueue<Range> q = new PriorityQueue<Range>(new Com());

        for(int i=0;i<x;i++)
        {
             q.add(new Range(arr[i][0],i,0));
        }

        for(int i=0;i<x*y;i++)
        {
             Range p = q.poll();
             int ari = p.y;
               int oi = p.z;
             pw.println(p.x);

             if(arr[ari].length-1==oi)
             {
                  q.add(new Range(Integer.MAX_VALUE,-1,-1));
             }
             else
             {
                  q.add(new Range(arr[ari][oi+1],ari,oi+1));
             }

        }

        */

         /* int[] P = {3, 5, 3, 8, 3, 6};

		int n = D.length;
		int pt = P[0];

		int st=0;
		int fst=st;
		int i=0;
		while(true)
		{
		    pw.println("st "+st+" i- "+i);
		     if(D[i]<=pt)
		     {
		          pt=pt-D[i]+P[(i+1)%6];
		          //i++;
		          i=(i+1)%6;
		          if(i==st)
		          {
		               pw.println("path from "+st);
		               break;
		          }
		     }
		     else
		     {
		          st=(i+1)%6;
		         i=st;
		         if(st==0)
		         {
		              pw.println("No path");
		              break;
		         }
		          pt=P[i];

		     }
		}
		*/

			    pw.close();

		}

	}


	import java.io.*;

	import java.util.*;

	   public  class Main {

		public static void main(String[] args) {

          int n = sc.nextInt();
          int k = sc.nextInt();

          int arr[] = new int[n];

          for(int i=0;i<n;i++)arr[i]=sc.nextInt();

          Arrays.sort(arr);

          int max=arr[n-1];
          int req = max/2;
          int ans=0;
          int curr=2*k;
          for(int i=0;i<n;i++)
          {
               int ai = arr[i];
               if(ai<=curr)
               {

                    curr=Math.max(curr,2*ai);

               }
               else
               {
                   //pw.println("f");
                   curr=2*curr;
                   ans++;
               }

          }
          pw.println(ans+" "+curr);

			    pw.close();

		}

		/*public static int ispr(int n)
	    	{
	    	//boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) {
	            Prime[i] = true;
	        }

	        // mark non-primes <= n using Sieve of Eratosthenes
	        for (int factor = 2; factor*factor <= n; factor++) {

	            // if factor is prime, then mark multiples of factor as nonprime
	            // suffices to consider mutiples factor, factor+1, ...,  n/factor
	            if (Prime[factor]) {
	                for (int j = factor; factor*j <= n; j++) {
	                    Prime[factor*j] = false;
	                }
	            }
	        }
	        // count primes

	        /*int primes = 0;
	        for (int i = 2; i <= n; i++) {
	            if (isPrime	[i])System.out.println(i);

	        }*/
		// System.out.println("The number of primes <= " + n + " is " + primes);
		//return 0;
		// if(isPrime[n]==true)return 1; else return 0;

		//}

		public static long fact(long x)
		{
			if(x==0)return 1;
			else return x*fact(x-1);
		}

		public static long exp(long x, long n, long M)
		{

			if(n==0) return 1;

			else if(n%2==0) return exp((x*x)%M,n/2,M);
			else return (x*exp((x*x)%M,(n-1)/2,M))%M;

		}

		//fi

		static long fib(long n)
		{
			long F[][] = new long[][]{{1,1},{1,0}};
			if (n == 0)
				return 0;
			power(F, n-1);

			return F[0][0];
		}

		static int mod=1000000007;

		static void multiply(long F[][], long M[][])
		{
			long x =  (((F[0][0]%mod)*(M[0][0]%mod))%mod + ((F[0][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long y =  (((F[0][0]%mod)*(M[0][1]%mod))%mod + ((F[0][1]%mod)*(M[1][1]%mod))%mod)%mod;
			long z =  (((F[1][0]%mod)*(M[0][0]%mod))%mod + ((F[1][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long w =  (((F[1][0]%mod)*(M[0][1]%mod))%mod + ((F[1][1]%mod)*(M[1][1]%mod))%mod)%mod;

			F[0][0] = x;
			F[0][1] = y;
			F[1][0] = z;
			F[1][1] = w;
		}

		/* Optimized version of power() in method 4 */
		static void power(long F[][], long n)
		{
			if( n == 0 || n == 1)
				return;
			long M[][] = new long[][]{{1,1},{1,0}};

			power(F, n/2);
			multiply(F, F);

			if (n%2 != 0)
				multiply(F, M);
		}

		public static int gcd(int a, int b)
		{
			if(b==0)
				return a;
			else return gcd(b,a%b);
		}

		static  class MyScanner {

			BufferedReader br;
			StringTokenizer st;

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

			String next() {
				while (st == null || !st.hasMoreElements()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return st.nextToken();
			}

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

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

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

			String nextLine(){
				String str = "";
				try {
					str = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				return str;
			}

		}

		static MyScanner sc = new  MyScanner();
		static PrintWriter pw = new PrintWriter(System.out, true);

		static void printPath(int parent[], int j)
		{
		    // Base Case : If j is source
		    if (parent[j]==-1)
		        {pw.print(j+" ");return;}

		    printPath(parent, parent[j]);

		    pw.print(j+" ");
		}

		//Main begins here :)
	/*
		public static class Pair{
		    int a;
		    int b;
		    Pair(int p,int q){
		        a=p;
		        b=q;
		    }
		    public boolean equals(Object o) {
		        if (o instanceof Pair) {
		            Pair p = (Pair)o;
		            return p.a == a && p.b == b;
		        }
		        return false;
		    }
		    public int hashCode() {
		        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		    }
		}
		*/

		public static int max1(String st, int k)
		{
			int n1=0;
			int max=Integer.MIN_VALUE;
			int n = st.length();
			if(n==1)
			{
				if(st.charAt(0)=='1')return 1;
				else return 0;
			}

			for(int i=1;i<=k;i++)
			{
				int chp=i-1;

				if(st.charAt(chp)=='1')n1++;

			}
			max=Math.max(max, n1);
		//	if(k>=n)return max;
			int slides=n-k;
			int ptr1=0, ptr2=k-1;

			for(int i=1;i<=slides;i++)
			{
				//pw.println(st.substring(ptr1+i, ptr2+i+1));
				ptr1++; ptr2++;
				if(st.charAt(ptr1-1)=='1')n1--;
				if(st.charAt(ptr2)=='1')n1++;
				//pw.println("m1- "+n1);pw

				if(n1>max)max=n1;
				if(max==k){return k;}
			}

			return max;

		}

		public static String shift(String A)
		{
			char lc = A.charAt(A.length()-1);
			return lc+A.substring(0,A.length()-1);

		}

		static  class Point
		{
			long x,y;

			public Point(long a, long b)
			{
				x=a;
				y=b;
			}

			public int compareTo(Point o) {
				// TODO Auto-generated method stub
				return Long.compare(this.x, o.x);

			}

		}

		static class compx implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.x>b.x)return 1;
				if(a.x<b.x) return -1;

				return 0;
			}
		}

		static class compy implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.y>b.y)return 1;
				if(a.y<b.y) return -1;

				return 0;
			}
		}

		public static int lucky(long y)
		{

			long d = y;
			int flg=0;
			//long nd = (long)Math.floor(Math.log10((double)y));
			//pw.println(nd);
			for(;d>=1;d=d/10)
			{
				long dg = d%10;
				if(dg!=0)flg++;
				if(flg==2)return 0;

			}
			return 1;

		}

		public static int diff(Time n, Time k)
		{

			int hn=n.h,mn=n.m,sn=n.s;
			int hk=k.h,mk=k.m,sk=k.s;

			int tc=0,cs=0,cm=0,ch=0;
			if(sk>sn)
			{
				int o1 = sk-sn;
				int o2 = sn+60-sk;

				if(o1>o2)
				{
					cs=o2;
					mn--;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn-1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn--;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(sk<sn)
			{
				int o1 = sn-sk;
				int o2 = sk+60-sn;

				if(o1>o2)
				{
					cs=o2;
					mn++;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn+1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn++;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(mk>mn)
			{
				int o1 = mk-mn;
				int o2 = mn+60-mk;

				if(o1>o2)
				{
					cm=o2;
					hn--;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn-1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn--;
					}
					else
					{
						cm=o1;
					}
				}
			}

			if(mk<mn)
			{
				int o1 = mn-mk;
				int o2 = mk+60-mn;

				if(o1>o2)
				{
					cm=o2;
					hn++;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn+1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn++;
					}
					else
					{
						cm=o1;
					}
				}
			}

			ch = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
			tc=cs+cm+ch;
			return tc;

			//return 3;
		}

		public static class Time
		{
			int h,m,s;

			public Time(int x, int y, int z)
			{
				h=x; m=y; s=z;

			}

		}

		static class Pair
		{
		    int x;
		    int y;

		    public Pair(int a , int b)
		    {
		        x=a;
		        y=b;
		    }

		}

		static class comp implements Comparator<Pair>
		{

		    @Override

		    public int compare(Pair a ,Pair b)
		    {
		        if(b.x>a.x)return -1;
		        if(b.x<a.x)return 1;
		        return 0;

		    }

		}
		static class compv implements Comparator<Vouch>
		{

		    @Override

		    public int compare(Vouch a ,Vouch b)
		    {
		        if(b.c>a.c)return -1;
		        if(b.c<a.c)return 1;
		        return 0;

		    }

		}

		static class Vouch
		{
		   int l,r, c;

		    public Vouch(int a ,int b, int ci)
		    {
		        l=a;
		        r=b;
		        c=ci;

		    }

		}

		public static int strStr(final String haystack, final String needle) {

			if(needle.equals("")) return -1;
		    if(haystack.equals("")&&needle.equals(""))return -1;

		    String temp="";

		    int hl = haystack.length();
		    int nl = needle.length();
		    if(nl>hl) return -1;
		    int ret=-1;
	        String wind = haystack.substring(0,nl);
	        pw.println(wind);
	        if(wind.equals(needle)) return 0;

	        for(int i=1;i<hl-nl;i++)
	        {
	            wind = wind.substring(1, wind.length());

	            wind = wind+haystack.charAt(i+nl);

	            pw.println(i+" "+wind);
	            if(wind.equals(needle))
	            {
	                ret=i; break;
	            }

	        }

	        return (ret==-1)?-1:ret;

			}

		public static int diff(String a, String b)
		{
			int ret=0;
			for(int i=0;i<a.length();i++)
			{
				if(a.charAt(i)!=b.charAt(i))ret++;
			}
			return ret;
		}

		public static boolean inter(Vouch a, Vouch b)
		{
			//return true if there's intersection
			int s1 = a.l;
			int e1 = a.r;

			int s2 = b.l;
			int e2 = b.r;

			if(s1<s2)
			{
				if(e1>=s2)return true;
				else return false;
			}
			else if(s1>s2)
			{
				if(e2>=s1) return true;
				else return false;
			}
			else
			{
				return true;
			}

		}

		static class Com implements Comparator<Range>
		{
		    public int compare(Range a, Range b)
		    {
		         int ac=a.x; int bc=b.x;
		         if(ac>bc)return 1;
		          if(ac<bc)return -1;
		          return 0;

		    }

		}
		static class Range
		{
		    int x,y,z;

		    public Range(int a, int b,int c)
		    {
		        x=a;
		        y=b;
		        z=c;
		    }

		}

		//static ArrayList<Integer> pr;

	}


	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.io.PrintWriter;
	import java.util.ArrayList;
	import java.util.Arrays;
	import java.util.Map.Entry;
	import java.util.PriorityQueue;
	import java.util.StringTokenizer;
	import java.util.*;

	   public  class Main {

		/*public static int ispr(int n)
	    	{
	    	//boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) {
	            Prime[i] = true;
	        }

	        // mark non-primes <= n using Sieve of Eratosthenes
	        for (int factor = 2; factor*factor <= n; factor++) {

	            // if factor is prime, then mark multiples of factor as nonprime
	            // suffices to consider mutiples factor, factor+1, ...,  n/factor
	            if (Prime[factor]) {
	                for (int j = factor; factor*j <= n; j++) {
	                    Prime[factor*j] = false;
	                }
	            }
	        }
	        // count primes

	        /*int primes = 0;
	        for (int i = 2; i <= n; i++) {
	            if (isPrime	[i])System.out.println(i);

	        }*/
		// System.out.println("The number of primes <= " + n + " is " + primes);
		//return 0;
		// if(isPrime[n]==true)return 1; else return 0;

		//}

		public static long fact(long x)
		{
			if(x==0)return 1;
			else return x*fact(x-1);
		}

		public static long exp(long x, long n, long M)
		{

			if(n==0) return 1;

			else if(n%2==0) return exp((x*x)%M,n/2,M);
			else return (x*exp((x*x)%M,(n-1)/2,M))%M;

		}

		//fi

		static long fib(long n)
		{
			long F[][] = new long[][]{{1,1},{1,0}};
			if (n == 0)
				return 0;
			power(F, n-1);

			return F[0][0];
		}

		static int mod=1000000007;

		static void multiply(long F[][], long M[][])
		{
			long x =  (((F[0][0]%mod)*(M[0][0]%mod))%mod + ((F[0][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long y =  (((F[0][0]%mod)*(M[0][1]%mod))%mod + ((F[0][1]%mod)*(M[1][1]%mod))%mod)%mod;
			long z =  (((F[1][0]%mod)*(M[0][0]%mod))%mod + ((F[1][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long w =  (((F[1][0]%mod)*(M[0][1]%mod))%mod + ((F[1][1]%mod)*(M[1][1]%mod))%mod)%mod;

			F[0][0] = x;
			F[0][1] = y;
			F[1][0] = z;
			F[1][1] = w;
		}

		/* Optimized version of power() in method 4 */
		static void power(long F[][], long n)
		{
			if( n == 0 || n == 1)
				return;
			long M[][] = new long[][]{{1,1},{1,0}};

			power(F, n/2);
			multiply(F, F);

			if (n%2 != 0)
				multiply(F, M);
		}

		public static int gcd(int a, int b)
		{
			if(b==0)
				return a;
			else return gcd(b,a%b);
		}

		static  class MyScanner {

			BufferedReader br;
			StringTokenizer st;

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

			String next() {
				while (st == null || !st.hasMoreElements()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return st.nextToken();
			}

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

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

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

			String nextLine(){
				String str = "";
				try {
					str = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				return str;
			}

		}

		static MyScanner sc = new  MyScanner();
		static PrintWriter pw = new PrintWriter(System.out, true);

		static void printPath(int parent[], int j)
		{
		    // Base Case : If j is source
		    if (parent[j]==-1)
		        {pw.print(j+" ");return;}

		    printPath(parent, parent[j]);

		    pw.print(j+" ");
		}

		//Main begins here :)
	/*
		public static class Pair{
		    int a;
		    int b;
		    Pair(int p,int q){
		        a=p;
		        b=q;
		    }
		    public boolean equals(Object o) {
		        if (o instanceof Pair) {
		            Pair p = (Pair)o;
		            return p.a == a && p.b == b;
		        }
		        return false;
		    }
		    public int hashCode() {
		        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		    }
		}
		*/

		public static int max1(String st, int k)
		{
			int n1=0;
			int max=Integer.MIN_VALUE;
			int n = st.length();
			if(n==1)
			{
				if(st.charAt(0)=='1')return 1;
				else return 0;
			}

			for(int i=1;i<=k;i++)
			{
				int chp=i-1;

				if(st.charAt(chp)=='1')n1++;

			}
			max=Math.max(max, n1);
		//	if(k>=n)return max;
			int slides=n-k;
			int ptr1=0, ptr2=k-1;

			for(int i=1;i<=slides;i++)
			{
				//pw.println(st.substring(ptr1+i, ptr2+i+1));
				ptr1++; ptr2++;
				if(st.charAt(ptr1-1)=='1')n1--;
				if(st.charAt(ptr2)=='1')n1++;
				//pw.println("m1- "+n1);pw

				if(n1>max)max=n1;
				if(max==k){return k;}
			}

			return max;

		}

		public static String shift(String A)
		{
			char lc = A.charAt(A.length()-1);
			return lc+A.substring(0,A.length()-1);

		}

		static  class Point
		{
			long x,y;

			public Point(long a, long b)
			{
				x=a;
				y=b;
			}

			public int compareTo(Point o) {
				// TODO Auto-generated method stub
				return Long.compare(this.x, o.x);

			}

		}

		static class compx implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.x>b.x)return 1;
				if(a.x<b.x) return -1;

				return 0;
			}
		}

		static class compy implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.y>b.y)return 1;
				if(a.y<b.y) return -1;

				return 0;
			}
		}

		public static int lucky(long y)
		{

			long d = y;
			int flg=0;
			//long nd = (long)Math.floor(Math.log10((double)y));
			//pw.println(nd);
			for(;d>=1;d=d/10)
			{
				long dg = d%10;
				if(dg!=0)flg++;
				if(flg==2)return 0;

			}
			return 1;

		}

		public static int diff(Time n, Time k)
		{

			int hn=n.h,mn=n.m,sn=n.s;
			int hk=k.h,mk=k.m,sk=k.s;

			int tc=0,cs=0,cm=0,ch=0;
			if(sk>sn)
			{
				int o1 = sk-sn;
				int o2 = sn+60-sk;

				if(o1>o2)
				{
					cs=o2;
					mn--;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn-1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn--;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(sk<sn)
			{
				int o1 = sn-sk;
				int o2 = sk+60-sn;

				if(o1>o2)
				{
					cs=o2;
					mn++;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn+1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn++;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(mk>mn)
			{
				int o1 = mk-mn;
				int o2 = mn+60-mk;

				if(o1>o2)
				{
					cm=o2;
					hn--;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn-1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn--;
					}
					else
					{
						cm=o1;
					}
				}
			}

			if(mk<mn)
			{
				int o1 = mn-mk;
				int o2 = mk+60-mn;

				if(o1>o2)
				{
					cm=o2;
					hn++;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn+1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn++;
					}
					else
					{
						cm=o1;
					}
				}
			}

			ch = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
			tc=cs+cm+ch;
			return tc;

			//return 3;
		}

		public static class Time
		{
			int h,m,s;

			public Time(int x, int y, int z)
			{
				h=x; m=y; s=z;

			}

		}

		static class Pair
		{
		    int x;
		    int y;

		    public Pair(int a , int b)
		    {
		        x=a;
		        y=b;
		    }

		}

		static class comp implements Comparator<Pair>
		{

		    @Override

		    public int compare(Pair a ,Pair b)
		    {
		        if(b.x>a.x)return -1;
		        if(b.x<a.x)return 1;
		        return 0;

		    }

		}
		static class compv implements Comparator<Vouch>
		{

		    @Override

		    public int compare(Vouch a ,Vouch b)
		    {
		        if(b.c>a.c)return -1;
		        if(b.c<a.c)return 1;
		        return 0;

		    }

		}

		static class Vouch
		{
		   int l,r, c;

		    public Vouch(int a ,int b, int ci)
		    {
		        l=a;
		        r=b;
		        c=ci;

		    }

		}

		public static int strStr(final String haystack, final String needle) {

			if(needle.equals("")) return -1;
		    if(haystack.equals("")&&needle.equals(""))return -1;

		    String temp="";

		    int hl = haystack.length();
		    int nl = needle.length();
		    if(nl>hl) return -1;
		    int ret=-1;
	        String wind = haystack.substring(0,nl);
	        pw.println(wind);
	        if(wind.equals(needle)) return 0;

	        for(int i=1;i<hl-nl;i++)
	        {
	            wind = wind.substring(1, wind.length());

	            wind = wind+haystack.charAt(i+nl);

	            pw.println(i+" "+wind);
	            if(wind.equals(needle))
	            {
	                ret=i; break;
	            }

	        }

	        return (ret==-1)?-1:ret;

			}

		public static int diff(String a, String b)
		{
			int ret=0;
			for(int i=0;i<a.length();i++)
			{
				if(a.charAt(i)!=b.charAt(i))ret++;
			}
			return ret;
		}

		public static boolean inter(Vouch a, Vouch b)
		{
			//return true if there's intersection
			int s1 = a.l;
			int e1 = a.r;

			int s2 = b.l;
			int e2 = b.r;

			if(s1<s2)
			{
				if(e1>=s2)return true;
				else return false;
			}
			else if(s1>s2)
			{
				if(e2>=s1) return true;
				else return false;
			}
			else
			{
				return true;
			}

		}

		static class Com implements Comparator<Range>
		{
		    public int compare(Range a, Range b)
		    {
		         int ac=a.x; int bc=b.x;
		         if(ac>bc)return 1;
		          if(ac<bc)return -1;
		          return 0;

		    }

		}
		static class Range
		{
		    int x,y,z;

		    public Range(int a, int b,int c)
		    {
		        x=a;
		        y=b;
		        z=c;
		    }

		}

		//static ArrayList<Integer> pr;
		public static void main(String[] args) {

          int n = sc.nextInt();
          int k = sc.nextInt();

          int arr[] = new int[n];

          for(int i=0;i<n;i++)arr[i]=sc.nextInt();

          Arrays.sort(arr);

          int max=arr[n-1];
          int req = max/2;
          int ans=0;
          int curr=2*k;
          for(int i=0;i<n&&curr<max;i++)
          {
               int ai = arr[i];
               if(ai<=curr)
               {

                    curr=Math.max(curr,2*ai);

               }
               else
               {
                   curr=2*curr;
                   ans++;
               }

          }
          pw.println(ans);

          	/*
	     String st = sc.nextLine();

	     Stack<Character> stk = new Stack<Character>();
	     stk.push(st.charAt(0));
	     for(int i=1;i<st.length();i++)
	     {

	                    char cc = st.charAt(i);

	                    if(stk.isEmpty())
	                    {
	                       stk.push(cc);
	                    }
	               else
	               {

	                    if(cc=='('||cc=='{'||cc=='[') stk.push(cc);

	                    char pr = stk.peek();
	                    if(cc==')')
	                    {
	                         if(pr=='(')stk.pop();
	                         else stk.push(cc);

	                    }

	          if(cc=='}')
	                    {
	                         if(pr=='{')stk.pop();
	                         else stk.push(cc);

	                    }

	                     if(cc==']')
	                    {
	                         if(pr=='[')stk.pop();
	                         else stk.push(cc);

	                    }
	               }

	     }
	     if(stk.isEmpty())pw.println("B");
	     else pw.println("NB");

	     while(!stk.isEmpty())pw.println(stk.pop());
	     */

		/*
		int[] D = {4, 7, 4, 8, 4, 1};
        int[] arr = {2,4,5,5,6,9,11,11,13};

        int l=0;
        int r =arr.length-1;
        int sr=12;
        int mid=0;
        int flg=0;
        while(l<=r)
        {
             mid=(l+r)/2;
             if(arr[mid]>sr)r=mid-1;
              if(arr[mid]<sr)l=mid+1;
               if(arr[mid]==sr)
               {
                    flg=1;
                    break;
               }

        }
       */
        //pw.println(l+" "+r);

        /*
          int[] ar= {2,1,5,3,4,8,7};
          Stack<Integer> st =new  Stack<Integer>();

          for(int i=0;i<ar.length-1;i++)
          {
               if(st.isEmpty())
               {
                   st.push(ar[i]);

               }
               else
               {
                    while(!st.isEmpty()&&st.peek()<ar[i])
                    {
                         int g=st.pop();
                         pw.println(g+"--< "+ar[i]);
                       if(ar[i]==8)
                       {
                            pw.println(g);
                       }
                    }
                    st.push(ar[i]);

               }

          }

        while(!st.isEmpty())
        {
            pw.println(st.pop()+"--< -1");

        }
        */
       /* int x,y;
        x=sc.nextInt();
        y=sc.nextInt();

        int[][] arr = new int[x][y];

        for(int i=0;i<x;i++)
        {
             for(int j=0;j<y;j++)
             {
                  arr[i][j]=sc.nextInt();
             }
        }

        PriorityQueue<Range> q = new PriorityQueue<Range>(new Com());

        for(int i=0;i<x;i++)
        {
             q.add(new Range(arr[i][0],i,0));
        }

        for(int i=0;i<x*y;i++)
        {
             Range p = q.poll();
             int ari = p.y;
               int oi = p.z;
             pw.println(p.x);

             if(arr[ari].length-1==oi)
             {
                  q.add(new Range(Integer.MAX_VALUE,-1,-1));
             }
             else
             {
                  q.add(new Range(arr[ari][oi+1],ari,oi+1));
             }

        }

        */

         /* int[] P = {3, 5, 3, 8, 3, 6};

		int n = D.length;
		int pt = P[0];

		int st=0;
		int fst=st;
		int i=0;
		while(true)
		{
		    pw.println("st "+st+" i- "+i);
		     if(D[i]<=pt)
		     {
		          pt=pt-D[i]+P[(i+1)%6];
		          //i++;
		          i=(i+1)%6;
		          if(i==st)
		          {
		               pw.println("path from "+st);
		               break;
		          }
		     }
		     else
		     {
		          st=(i+1)%6;
		         i=st;
		         if(st==0)
		         {
		              pw.println("No path");
		              break;
		         }
		          pt=P[i];

		     }
		}
		*/

			    pw.close();

		}

	}


	import java.io.*;

	import java.util.*;

	   public  class Main {

		public static void main(String[] args) {

          int n = sc.nextInt();
          int k = sc.nextInt();

          int arr[] = new int[n];

          for(int i=0;i<n;i++)arr[i]=sc.nextInt();

          Arrays.sort(arr);

          int max=arr[n-1];
          int req = max/2;
          int ans=0;
          long curr=2*k;
          for(int i=0;i<n&&curr<max;i++)
          {
               int ai = arr[i];
               //pw.println("ai "+ai+" curr "+curr);
               if(ai<=curr)
               {

                    curr=Math.max(curr,2*ai);

               }
               else
               {
                   // pw.println("ai "+ai+" curr "+curr);
                   while(ai>curr)
                   {
                   curr=2*curr;
                   ans++;
                   }
                   curr=Math.max(curr,2*ai);
               }

          }
          pw.println(ans);

			    pw.close();

		}

		/*public static int ispr(int n)
	    	{
	    	//boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) {
	            Prime[i] = true;
	        }

	        // mark non-primes <= n using Sieve of Eratosthenes
	        for (int factor = 2; factor*factor <= n; factor++) {

	            // if factor is prime, then mark multiples of factor as nonprime
	            // suffices to consider mutiples factor, factor+1, ...,  n/factor
	            if (Prime[factor]) {
	                for (int j = factor; factor*j <= n; j++) {
	                    Prime[factor*j] = false;
	                }
	            }
	        }
	        // count primes

	        /*int primes = 0;
	        for (int i = 2; i <= n; i++) {
	            if (isPrime	[i])System.out.println(i);

	        }*/
		// System.out.println("The number of primes <= " + n + " is " + primes);
		//return 0;
		// if(isPrime[n]==true)return 1; else return 0;

		//}

		public static long fact(long x)
		{
			if(x==0)return 1;
			else return x*fact(x-1);
		}

		public static long exp(long x, long n, long M)
		{

			if(n==0) return 1;

			else if(n%2==0) return exp((x*x)%M,n/2,M);
			else return (x*exp((x*x)%M,(n-1)/2,M))%M;

		}

		//fi

		static long fib(long n)
		{
			long F[][] = new long[][]{{1,1},{1,0}};
			if (n == 0)
				return 0;
			power(F, n-1);

			return F[0][0];
		}

		static int mod=1000000007;

		static void multiply(long F[][], long M[][])
		{
			long x =  (((F[0][0]%mod)*(M[0][0]%mod))%mod + ((F[0][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long y =  (((F[0][0]%mod)*(M[0][1]%mod))%mod + ((F[0][1]%mod)*(M[1][1]%mod))%mod)%mod;
			long z =  (((F[1][0]%mod)*(M[0][0]%mod))%mod + ((F[1][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long w =  (((F[1][0]%mod)*(M[0][1]%mod))%mod + ((F[1][1]%mod)*(M[1][1]%mod))%mod)%mod;

			F[0][0] = x;
			F[0][1] = y;
			F[1][0] = z;
			F[1][1] = w;
		}

		/* Optimized version of power() in method 4 */
		static void power(long F[][], long n)
		{
			if( n == 0 || n == 1)
				return;
			long M[][] = new long[][]{{1,1},{1,0}};

			power(F, n/2);
			multiply(F, F);

			if (n%2 != 0)
				multiply(F, M);
		}

		public static int gcd(int a, int b)
		{
			if(b==0)
				return a;
			else return gcd(b,a%b);
		}

		static  class MyScanner {

			BufferedReader br;
			StringTokenizer st;

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

			String next() {
				while (st == null || !st.hasMoreElements()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return st.nextToken();
			}

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

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

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

			String nextLine(){
				String str = "";
				try {
					str = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				return str;
			}

		}

		static MyScanner sc = new  MyScanner();
		static PrintWriter pw = new PrintWriter(System.out, true);

		static void printPath(int parent[], int j)
		{
		    // Base Case : If j is source
		    if (parent[j]==-1)
		        {pw.print(j+" ");return;}

		    printPath(parent, parent[j]);

		    pw.print(j+" ");
		}

		//Main begins here :)
	/*
		public static class Pair{
		    int a;
		    int b;
		    Pair(int p,int q){
		        a=p;
		        b=q;
		    }
		    public boolean equals(Object o) {
		        if (o instanceof Pair) {
		            Pair p = (Pair)o;
		            return p.a == a && p.b == b;
		        }
		        return false;
		    }
		    public int hashCode() {
		        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		    }
		}
		*/

		public static int max1(String st, int k)
		{
			int n1=0;
			int max=Integer.MIN_VALUE;
			int n = st.length();
			if(n==1)
			{
				if(st.charAt(0)=='1')return 1;
				else return 0;
			}

			for(int i=1;i<=k;i++)
			{
				int chp=i-1;

				if(st.charAt(chp)=='1')n1++;

			}
			max=Math.max(max, n1);
		//	if(k>=n)return max;
			int slides=n-k;
			int ptr1=0, ptr2=k-1;

			for(int i=1;i<=slides;i++)
			{
				//pw.println(st.substring(ptr1+i, ptr2+i+1));
				ptr1++; ptr2++;
				if(st.charAt(ptr1-1)=='1')n1--;
				if(st.charAt(ptr2)=='1')n1++;
				//pw.println("m1- "+n1);pw

				if(n1>max)max=n1;
				if(max==k){return k;}
			}

			return max;

		}

		public static String shift(String A)
		{
			char lc = A.charAt(A.length()-1);
			return lc+A.substring(0,A.length()-1);

		}

		static  class Point
		{
			long x,y;

			public Point(long a, long b)
			{
				x=a;
				y=b;
			}

			public int compareTo(Point o) {
				// TODO Auto-generated method stub
				return Long.compare(this.x, o.x);

			}

		}

		static class compx implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.x>b.x)return 1;
				if(a.x<b.x) return -1;

				return 0;
			}
		}

		static class compy implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.y>b.y)return 1;
				if(a.y<b.y) return -1;

				return 0;
			}
		}

		public static int lucky(long y)
		{

			long d = y;
			int flg=0;
			//long nd = (long)Math.floor(Math.log10((double)y));
			//pw.println(nd);
			for(;d>=1;d=d/10)
			{
				long dg = d%10;
				if(dg!=0)flg++;
				if(flg==2)return 0;

			}
			return 1;

		}

		public static int diff(Time n, Time k)
		{

			int hn=n.h,mn=n.m,sn=n.s;
			int hk=k.h,mk=k.m,sk=k.s;

			int tc=0,cs=0,cm=0,ch=0;
			if(sk>sn)
			{
				int o1 = sk-sn;
				int o2 = sn+60-sk;

				if(o1>o2)
				{
					cs=o2;
					mn--;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn-1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn--;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(sk<sn)
			{
				int o1 = sn-sk;
				int o2 = sk+60-sn;

				if(o1>o2)
				{
					cs=o2;
					mn++;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn+1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn++;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(mk>mn)
			{
				int o1 = mk-mn;
				int o2 = mn+60-mk;

				if(o1>o2)
				{
					cm=o2;
					hn--;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn-1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn--;
					}
					else
					{
						cm=o1;
					}
				}
			}

			if(mk<mn)
			{
				int o1 = mn-mk;
				int o2 = mk+60-mn;

				if(o1>o2)
				{
					cm=o2;
					hn++;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn+1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn++;
					}
					else
					{
						cm=o1;
					}
				}
			}

			ch = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
			tc=cs+cm+ch;
			return tc;

			//return 3;
		}

		public static class Time
		{
			int h,m,s;

			public Time(int x, int y, int z)
			{
				h=x; m=y; s=z;

			}

		}

		static class Pair
		{
		    int x;
		    int y;

		    public Pair(int a , int b)
		    {
		        x=a;
		        y=b;
		    }

		}

		static class comp implements Comparator<Pair>
		{

		    @Override

		    public int compare(Pair a ,Pair b)
		    {
		        if(b.x>a.x)return -1;
		        if(b.x<a.x)return 1;
		        return 0;

		    }

		}
		static class compv implements Comparator<Vouch>
		{

		    @Override

		    public int compare(Vouch a ,Vouch b)
		    {
		        if(b.c>a.c)return -1;
		        if(b.c<a.c)return 1;
		        return 0;

		    }

		}

		static class Vouch
		{
		   int l,r, c;

		    public Vouch(int a ,int b, int ci)
		    {
		        l=a;
		        r=b;
		        c=ci;

		    }

		}

		public static int strStr(final String haystack, final String needle) {

			if(needle.equals("")) return -1;
		    if(haystack.equals("")&&needle.equals(""))return -1;

		    String temp="";

		    int hl = haystack.length();
		    int nl = needle.length();
		    if(nl>hl) return -1;
		    int ret=-1;
	        String wind = haystack.substring(0,nl);
	        pw.println(wind);
	        if(wind.equals(needle)) return 0;

	        for(int i=1;i<hl-nl;i++)
	        {
	            wind = wind.substring(1, wind.length());

	            wind = wind+haystack.charAt(i+nl);

	            pw.println(i+" "+wind);
	            if(wind.equals(needle))
	            {
	                ret=i; break;
	            }

	        }

	        return (ret==-1)?-1:ret;

			}

		public static int diff(String a, String b)
		{
			int ret=0;
			for(int i=0;i<a.length();i++)
			{
				if(a.charAt(i)!=b.charAt(i))ret++;
			}
			return ret;
		}

		public static boolean inter(Vouch a, Vouch b)
		{
			//return true if there's intersection
			int s1 = a.l;
			int e1 = a.r;

			int s2 = b.l;
			int e2 = b.r;

			if(s1<s2)
			{
				if(e1>=s2)return true;
				else return false;
			}
			else if(s1>s2)
			{
				if(e2>=s1) return true;
				else return false;
			}
			else
			{
				return true;
			}

		}

		static class Com implements Comparator<Range>
		{
		    public int compare(Range a, Range b)
		    {
		         int ac=a.x; int bc=b.x;
		         if(ac>bc)return 1;
		          if(ac<bc)return -1;
		          return 0;

		    }

		}
		static class Range
		{
		    int x,y,z;

		    public Range(int a, int b,int c)
		    {
		        x=a;
		        y=b;
		        z=c;
		    }

		}

		//static ArrayList<Integer> pr;

	}


	import java.io.*;

	import java.util.*;

	   public  class Main {

		public static void main(String[] args) {

          int n = sc.nextInt();
          int k = sc.nextInt();

          int arr[] = new int[n];

          for(int i=0;i<n;i++)arr[i]=sc.nextInt();

          Arrays.sort(arr);

          int max=arr[n-1];
          int req = max/2;
          int ans=0;
          int curr=2*k;
          for(int i=0;i<n&&curr<max;i++)
          {
               int ai = arr[i];
               //pw.println("ai "+ai+" curr "+curr);
               if(ai<=curr)
               {

                    curr=Math.max(curr,2*ai);

               }
               else
               {
                   // pw.println("ai "+ai+" curr "+curr);
                   while(ai>curr)
                   {
                   curr=2*curr;
                   ans++;
                   }
               }

          }
          pw.println(ans);

			    pw.close();

		}

		/*public static int ispr(int n)
	    	{
	    	//boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) {
	            Prime[i] = true;
	        }

	        // mark non-primes <= n using Sieve of Eratosthenes
	        for (int factor = 2; factor*factor <= n; factor++) {

	            // if factor is prime, then mark multiples of factor as nonprime
	            // suffices to consider mutiples factor, factor+1, ...,  n/factor
	            if (Prime[factor]) {
	                for (int j = factor; factor*j <= n; j++) {
	                    Prime[factor*j] = false;
	                }
	            }
	        }
	        // count primes

	        /*int primes = 0;
	        for (int i = 2; i <= n; i++) {
	            if (isPrime	[i])System.out.println(i);

	        }*/
		// System.out.println("The number of primes <= " + n + " is " + primes);
		//return 0;
		// if(isPrime[n]==true)return 1; else return 0;

		//}

		public static long fact(long x)
		{
			if(x==0)return 1;
			else return x*fact(x-1);
		}

		public static long exp(long x, long n, long M)
		{

			if(n==0) return 1;

			else if(n%2==0) return exp((x*x)%M,n/2,M);
			else return (x*exp((x*x)%M,(n-1)/2,M))%M;

		}

		//fi

		static long fib(long n)
		{
			long F[][] = new long[][]{{1,1},{1,0}};
			if (n == 0)
				return 0;
			power(F, n-1);

			return F[0][0];
		}

		static int mod=1000000007;

		static void multiply(long F[][], long M[][])
		{
			long x =  (((F[0][0]%mod)*(M[0][0]%mod))%mod + ((F[0][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long y =  (((F[0][0]%mod)*(M[0][1]%mod))%mod + ((F[0][1]%mod)*(M[1][1]%mod))%mod)%mod;
			long z =  (((F[1][0]%mod)*(M[0][0]%mod))%mod + ((F[1][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long w =  (((F[1][0]%mod)*(M[0][1]%mod))%mod + ((F[1][1]%mod)*(M[1][1]%mod))%mod)%mod;

			F[0][0] = x;
			F[0][1] = y;
			F[1][0] = z;
			F[1][1] = w;
		}

		/* Optimized version of power() in method 4 */
		static void power(long F[][], long n)
		{
			if( n == 0 || n == 1)
				return;
			long M[][] = new long[][]{{1,1},{1,0}};

			power(F, n/2);
			multiply(F, F);

			if (n%2 != 0)
				multiply(F, M);
		}

		public static int gcd(int a, int b)
		{
			if(b==0)
				return a;
			else return gcd(b,a%b);
		}

		static  class MyScanner {

			BufferedReader br;
			StringTokenizer st;

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

			String next() {
				while (st == null || !st.hasMoreElements()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return st.nextToken();
			}

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

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

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

			String nextLine(){
				String str = "";
				try {
					str = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				return str;
			}

		}

		static MyScanner sc = new  MyScanner();
		static PrintWriter pw = new PrintWriter(System.out, true);

		static void printPath(int parent[], int j)
		{
		    // Base Case : If j is source
		    if (parent[j]==-1)
		        {pw.print(j+" ");return;}

		    printPath(parent, parent[j]);

		    pw.print(j+" ");
		}

		//Main begins here :)
	/*
		public static class Pair{
		    int a;
		    int b;
		    Pair(int p,int q){
		        a=p;
		        b=q;
		    }
		    public boolean equals(Object o) {
		        if (o instanceof Pair) {
		            Pair p = (Pair)o;
		            return p.a == a && p.b == b;
		        }
		        return false;
		    }
		    public int hashCode() {
		        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		    }
		}
		*/

		public static int max1(String st, int k)
		{
			int n1=0;
			int max=Integer.MIN_VALUE;
			int n = st.length();
			if(n==1)
			{
				if(st.charAt(0)=='1')return 1;
				else return 0;
			}

			for(int i=1;i<=k;i++)
			{
				int chp=i-1;

				if(st.charAt(chp)=='1')n1++;

			}
			max=Math.max(max, n1);
		//	if(k>=n)return max;
			int slides=n-k;
			int ptr1=0, ptr2=k-1;

			for(int i=1;i<=slides;i++)
			{
				//pw.println(st.substring(ptr1+i, ptr2+i+1));
				ptr1++; ptr2++;
				if(st.charAt(ptr1-1)=='1')n1--;
				if(st.charAt(ptr2)=='1')n1++;
				//pw.println("m1- "+n1);pw

				if(n1>max)max=n1;
				if(max==k){return k;}
			}

			return max;

		}

		public static String shift(String A)
		{
			char lc = A.charAt(A.length()-1);
			return lc+A.substring(0,A.length()-1);

		}

		static  class Point
		{
			long x,y;

			public Point(long a, long b)
			{
				x=a;
				y=b;
			}

			public int compareTo(Point o) {
				// TODO Auto-generated method stub
				return Long.compare(this.x, o.x);

			}

		}

		static class compx implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.x>b.x)return 1;
				if(a.x<b.x) return -1;

				return 0;
			}
		}

		static class compy implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.y>b.y)return 1;
				if(a.y<b.y) return -1;

				return 0;
			}
		}

		public static int lucky(long y)
		{

			long d = y;
			int flg=0;
			//long nd = (long)Math.floor(Math.log10((double)y));
			//pw.println(nd);
			for(;d>=1;d=d/10)
			{
				long dg = d%10;
				if(dg!=0)flg++;
				if(flg==2)return 0;

			}
			return 1;

		}

		public static int diff(Time n, Time k)
		{

			int hn=n.h,mn=n.m,sn=n.s;
			int hk=k.h,mk=k.m,sk=k.s;

			int tc=0,cs=0,cm=0,ch=0;
			if(sk>sn)
			{
				int o1 = sk-sn;
				int o2 = sn+60-sk;

				if(o1>o2)
				{
					cs=o2;
					mn--;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn-1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn--;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(sk<sn)
			{
				int o1 = sn-sk;
				int o2 = sk+60-sn;

				if(o1>o2)
				{
					cs=o2;
					mn++;
				}
				if(o2>o1)
				{
					cs=o1;
				}
				if(o1==o2)
				{

					int min1 = Math.min(Math.abs(mk-mn), 60 - Math.abs(mk-mn));
					int mn2 = mn+1;
					int min2  = Math.min(Math.abs(mk-mn2), 60 - Math.abs(mk-mn2));
					if(min2<min1)
					{
						cs=o2;
						mn++;
					}
					else
					{
						cs=o1;
					}

				}
			}

			if(mk>mn)
			{
				int o1 = mk-mn;
				int o2 = mn+60-mk;

				if(o1>o2)
				{
					cm=o2;
					hn--;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn-1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn--;
					}
					else
					{
						cm=o1;
					}
				}
			}

			if(mk<mn)
			{
				int o1 = mn-mk;
				int o2 = mk+60-mn;

				if(o1>o2)
				{
					cm=o2;
					hn++;
				}
				if(o2>o1)
				{
					cm=o1;
				}
				if(o1==o2)
				{
					int min1 = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
					int hn2 = hn+1;
					int min2  = Math.min(Math.abs(hk-hn2), 24 - Math.abs(hk-hn2));
					if(min2<min1)
					{
						cm=o2;
						hn++;
					}
					else
					{
						cm=o1;
					}
				}
			}

			ch = Math.min(Math.abs(hk-hn), 24 - Math.abs(hk-hn));
			tc=cs+cm+ch;
			return tc;

			//return 3;
		}

		public static class Time
		{
			int h,m,s;

			public Time(int x, int y, int z)
			{
				h=x; m=y; s=z;

			}

		}

		static class Pair
		{
		    int x;
		    int y;

		    public Pair(int a , int b)
		    {
		        x=a;
		        y=b;
		    }

		}

		static class comp implements Comparator<Pair>
		{

		    @Override

		    public int compare(Pair a ,Pair b)
		    {
		        if(b.x>a.x)return -1;
		        if(b.x<a.x)return 1;
		        return 0;

		    }

		}
		static class compv implements Comparator<Vouch>
		{

		    @Override

		    public int compare(Vouch a ,Vouch b)
		    {
		        if(b.c>a.c)return -1;
		        if(b.c<a.c)return 1;
		        return 0;

		    }

		}

		static class Vouch
		{
		   int l,r, c;

		    public Vouch(int a ,int b, int ci)
		    {
		        l=a;
		        r=b;
		        c=ci;

		    }

		}

		public static int strStr(final String haystack, final String needle) {

			if(needle.equals("")) return -1;
		    if(haystack.equals("")&&needle.equals(""))return -1;

		    String temp="";

		    int hl = haystack.length();
		    int nl = needle.length();
		    if(nl>hl) return -1;
		    int ret=-1;
	        String wind = haystack.substring(0,nl);
	        pw.println(wind);
	        if(wind.equals(needle)) return 0;

	        for(int i=1;i<hl-nl;i++)
	        {
	            wind = wind.substring(1, wind.length());

	            wind = wind+haystack.charAt(i+nl);

	            pw.println(i+" "+wind);
	            if(wind.equals(needle))
	            {
	                ret=i; break;
	            }

	        }

	        return (ret==-1)?-1:ret;

			}

		public static int diff(String a, String b)
		{
			int ret=0;
			for(int i=0;i<a.length();i++)
			{
				if(a.charAt(i)!=b.charAt(i))ret++;
			}
			return ret;
		}

		public static boolean inter(Vouch a, Vouch b)
		{
			//return true if there's intersection
			int s1 = a.l;
			int e1 = a.r;

			int s2 = b.l;
			int e2 = b.r;

			if(s1<s2)
			{
				if(e1>=s2)return true;
				else return false;
			}
			else if(s1>s2)
			{
				if(e2>=s1) return true;
				else return false;
			}
			else
			{
				return true;
			}

		}

		static class Com implements Comparator<Range>
		{
		    public int compare(Range a, Range b)
		    {
		         int ac=a.x; int bc=b.x;
		         if(ac>bc)return 1;
		          if(ac<bc)return -1;
		          return 0;

		    }

		}
		static class Range
		{
		    int x,y,z;

		    public Range(int a, int b,int c)
		    {
		        x=a;
		        y=b;
		        z=c;
		    }

		}

		//static ArrayList<Integer> pr;

	}


//package code;

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

public class A {

    static Scanner scan;

    void calc() {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();

        long res = 0, min = k / 2;
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i ++) {
            list.add(scan.nextInt());
        }

        Collections.sort(list);

        for (int v : list) {
            while (v / 2 > min) {
                res ++;
                min = min * 2 + 1;
            }
            min = Math.max(min, v);
        }

        System.out.println(res);
    }

    public static void main(String[] args) {

        A obj = new A();
        obj.calc();

    }

    class Elem {
        long r, h;
        public Elem(int r, int h) {
            this.r = r;
            this.h = h;
        }
    }

    class TreeNode {
        int val;
        TreeNode left, right;
        public TreeNode(int v) {
            val = v;
        }
    }

}


//package code;

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

public class A {

    static Scanner scan;

    void calc() {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();

        long res = 0, min = k / 2;
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i ++) {
            list.add(scan.nextInt());
        }

        Collections.sort(list);

        for (int v : list) {
            while (v / 2 > min) {
                res ++;
                min = min * 2;
            }
            min = Math.max(min, v);
        }

        System.out.println(res);
    }

    public static void main(String[] args) {

        A obj = new A();
        obj.calc();

    }

    class Elem {
        long r, h;
        public Elem(int r, int h) {
            this.r = r;
            this.h = h;
        }
    }

    class TreeNode {
        int val;
        TreeNode left, right;
        public TreeNode(int v) {
            val = v;
        }
    }

}


//package code;

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

public class A {

    static Scanner scan;

    void calc() {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();

        long res = 0, min = k * 2;
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i ++) {
            list.add(scan.nextLong());
        }

        Collections.sort(list);

        for (long v : list) {
            while (v > min) {
                res ++;
                min = min * 2;
            }
            min = Math.max(min, v * 2);
        }

        System.out.println(res);
    }

    public static void main(String[] args) {

        A obj = new A();
        obj.calc();

    }

    class Elem {
        long r, h;
        public Elem(int r, int h) {
            this.r = r;
            this.h = h;
        }
    }

    class TreeNode {
        int val;
        TreeNode left, right;
        public TreeNode(int v) {
            val = v;
        }
    }

}


package code;

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

public class A {

    static Scanner scan;

    void calc() {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();

        int res = 0, min = k / 2;
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i ++) {
            list.add(scan.nextInt());
        }

        Collections.sort(list);

        for (int v : list) {
            while (v / 2 > min) {
                res ++;
                min = min * 2 + 1;
            }
            min = Math.max(min, v);
        }

        System.out.println(res);
    }

    public static void main(String[] args) {

        A obj = new A();
        obj.calc();

    }

    class Elem {
        long r, h;
        public Elem(int r, int h) {
            this.r = r;
            this.h = h;
        }
    }

    class TreeNode {
        int val;
        TreeNode left, right;
        public TreeNode(int v) {
            val = v;
        }
    }

}


//package code;

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

public class A {

    static Scanner scan;

    void calc() {
        scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();

        int res = 0, min = k / 2;
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i ++) {
            list.add(scan.nextInt());
        }

        Collections.sort(list);

        for (int v : list) {
            if (v / 2 > min) {
                res ++;
            }
            min = Math.max(min, v);
        }

        System.out.println(res);
    }

    public static void main(String[] args) {

        A obj = new A();
        obj.calc();

    }

    class Elem {
        long r, h;
        public Elem(int r, int h) {
            this.r = r;
            this.h = h;
        }
    }

    class TreeNode {
        int val;
        TreeNode left, right;
        public TreeNode(int v) {
            val = v;
        }
    }

}


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

public class practice
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner hb=new Scanner(System.in);
		//BufferedReader hb=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter w=new PrintWriter(System.out);

		//int t=Integer.parseInt(hb.readLine());
		int n=hb.nextInt();
		int k=hb.nextInt();

		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=hb.nextInt();
		Arrays.sort(a);
		int ans=0;
		for(int i=0;i<n;i++)
		{
			if(2*k<a[i])
			{
				while(2*k<a[i])
				{
					ans++;
					k*=2;
				}
			}
		}
		w.print(ans);
		w.close();
	}

}


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

public class practice
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner hb=new Scanner(System.in);
		//BufferedReader hb=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter w=new PrintWriter(System.out);

		//int t=Integer.parseInt(hb.readLine());
		int n=hb.nextInt();
		int k=hb.nextInt();
		int ans=0;
		for(int i=0;i<n;i++)
		{
			int x=hb.nextInt();
			if((x/2)>k)
				ans=1;
		}
		w.print(ans);
		w.close();
	}
}


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

public class practice
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner hb=new Scanner(System.in);
		//BufferedReader hb=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter w=new PrintWriter(System.out);

		//int t=Integer.parseInt(hb.readLine());
		int n=hb.nextInt();
		int k=hb.nextInt();

		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=hb.nextInt();
		Arrays.sort(a);
		int ans=0;
		for(int i=0;i<n;i++)
		{
			while(2*k<a[i])
			{
				ans++;
				k*=2;
			}
			if (a[i] > k)
			{
				k = a[i];
			}
		}
		w.print(ans);
		w.close();
	}

}


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

public class MultiJudgeSolving {
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int n = s.nextInt();
		int k = s.nextInt();

		int[] array = new int[n];

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

		int highestDifficulty = k;

		Arrays.sort(array);

		int count = 0;

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

			boolean redo = false;

			if(highestDifficulty < Math.ceil(array[i]/2.0)) {
				count++;
				highestDifficulty = highestDifficulty * 2;
				redo = true;
			}

			if(array[i] > highestDifficulty) {
				highestDifficulty = array[i];
			}

			if(redo) i--;

		}

		System.out.println(count);

	}
}


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

public class MultiJudgeSolving {
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int n = s.nextInt();
		int k = s.nextInt();

		int[] array = new int[n];

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

		int highestDifficulty = k;

		Arrays.sort(array);

		int count = 0;

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

			if(highestDifficulty < Math.ceil(array[i]/2.0)) {
				count++;
				highestDifficulty = array[i];
			}else if(array[i] > highestDifficulty) {
				highestDifficulty = array[i];
			}

		}

		System.out.println(count);

	}
}


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

public class MultiJudgeSolving {
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int n = s.nextInt();
		int k = s.nextInt();

		int[] array = new int[n];

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

		int highestDifficulty = k;

		Arrays.sort(array);

		int count = 0;

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

			boolean redo = false;

			if(highestDifficulty < Math.ceil(array[i]/2.0)) {
				count++;
				highestDifficulty = highestDifficulty * 2;
				redo = true;
			} else if(array[i] > highestDifficulty) {
				highestDifficulty = array[i];
			}

			if(redo) i--;

		}

		System.out.println(count);

	}
}


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

public class MultiJudgeSolving {
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int n = s.nextInt();
		int k = s.nextInt();

		int[] array = new int[n];

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

		int highestDifficulty = k;

		Arrays.sort(array);

		int count = 0;

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

			if(highestDifficulty < Math.ceil(array[i]/2.0)) {
				count++;
				highestDifficulty = array[i];
			}

		}

		System.out.println(count);

	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Liavontsi Brechka
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static
    @SuppressWarnings("Duplicates")
    class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a = in.nextIntArray(n);
            Arrays.sort(a);
            long currentSolvable = k * 2;
            int res = 0;
            for (int i = 0; i < n; ) {
                if (a[i] <= currentSolvable) {
                    currentSolvable = Math.max(currentSolvable, a[i] * 2);
                    i++;
                    continue;
                }

                while (a[i] > currentSolvable) {
                    currentSolvable *= 2L;
                    res++;
                }
            }

            out.print(res);
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextInt();
            }
            return array;
        }

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

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Liavontsi Brechka
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static
    @SuppressWarnings("Duplicates")
    class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a = in.nextIntArray(n);
            Arrays.sort(a);
            long currentSolvable = k * 2;
            int res = 0;
            for (int i = 0; i < n; i++) {
                if (a[i] <= currentSolvable) {
                    currentSolvable = Math.max(currentSolvable, a[i] * 2);
                    continue;
                }

                while (a[i] > currentSolvable) {
                    currentSolvable *= 2L;
                    res++;
                }
            }

            out.print(res);
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextInt();
            }
            return array;
        }

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

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}


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

public class Main {
    public static void main (String [] args) {
        Scanner in = new Scanner (System.in);
        int n = in.nextInt (), k = in.nextInt ();
        int [] a = new int [n];
        for (int i = 0; i < n; ++ i)
            a[i] = in.nextInt ();
        Arrays.sort (a);

        int ans = 0;
        for (int i = 0; i < n; ++ i) {
            while (a[i] / 2 > k) {
                ++ ans;
                k *= 2;
                if (k % 2 == 0)
                    ++ k;
            }
            k = Math.max (k, a[i]);
        }

        System.out.println (ans);
    }
}


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

public class Main {
    public static void main (String [] args) {
        Scanner in = new Scanner (System.in);
        int n = in.nextInt (), k = in.nextInt ();
        int [] a = new int [n];
        for (int i = 0; i < n; ++ i)
            a[i] = in.nextInt ();
        Arrays.sort (a);

        int ans = 0;
        for (int i = 0; i < n; ++ i) {
            while (a[i] > k * 2) {
                ++ ans;
                k *= 2;
            }
            k = a[i] * 2;
        }

        System.out.println (ans);
    }
}


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

public class Main {
    public static void main (String [] args) {
        Scanner in = new Scanner (System.in);
        int n = in.nextInt (), k = in.nextInt ();
        int [] a = new int [n];
        for (int i = 0; i < n; ++ i)
            a[i] = in.nextInt ();
        Arrays.sort (a);

        int ans = 0;
        for (int i = 0; i < n; ++ i) {
            while (a[i] > k * 2) {
                ++ ans;
                k *= 2;
            }
            k = Math.max (k, a[i]);
        }

        System.out.println (ans);
    }
}


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

public class Main {
    public static void main (String [] args) {
        Scanner in = new Scanner (System.in);
        int n = in.nextInt (), k = in.nextInt ();
        int [] a = new int [n];
        for (int i = 0; i < n; ++ i)
            a[i] = in.nextInt ();
        Arrays.sort (a);

        int ans = 0;
        for (int i = 0; i < n; ++ i) {
            while (a[i] / 2 > k) {
                ++ ans;
                k *= 2;
                if (k % 2 == 0)
                    ++ k;
            }
            k = a[i];
        }

        System.out.println (ans);
    }
}


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

public class Main {
    public static void main (String [] args) {
        Scanner in = new Scanner (System.in);
        int n = in.nextInt (), k = in.nextInt ();
        int [] a = new int [n];
        for (int i = 0; i < n; ++ i)
            a[i] = in.nextInt ();
        Arrays.sort (a);

        int ans = 0;
        for (int i = 0; i < n; ++ i) {
            while (a[i] / 2 > k) {
                ++ ans;
                k *= 2;
                if (k % 2 == 0)
                    ++ k;
            }
            k = k.max (a[i]);
        }

        System.out.println (ans);
    }
}


#include<algorithm>
#include<iostream>
#include<set>
#include<cstdio>
using namespace std;
set<int> s;
int main () {
	int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
    	int tmp;
        cin>>tmp;
        s.insert(tmp);
    }
    s.erase(s.begin());
    if(s.empty())	printf("NO");
    else	cout<<*s.begin();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int d[100+10];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d",d+i);
	int ans=0x7fffffff;
	for(int i=0;i<n;i++)
			if(ans>d[i])ans=d[i];
	for(int i=0;i<n;i++)
			if(ans==d[i])d[i]=0x7fffffff;
	ans=0x7fffffff;
	for(int i=0;i<n;i++)
			if(ans>d[i])ans=d[i];

//	for(int i=0;i<n;i++)
//			if(ans==d[i])
//			{
//				printf("%d",ans);
//				return 0;
//			}
	printf("%d",ans);
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int a[101];
int k[222];
int main()
{
	int n;
	cin >> n ;
	int minn=999999;
	for(int i=1;i<=n;i++)
	{
		cin >> a[i] ;
		if(a[i]<minn)
		{
			minn=a[i];
		}
	}
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++)
	{
		if(a[i]>minn)
		{
			cout << a[i] << endl ;
			return 0;
		}
	}
	cout << "NO" ;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a[200];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int x;
		cin>>x;
		a[x+100]=1;
	}
	int t=0;
	for(int i=200;i>=1;i--)
	{
		if(a[i]!=0)
		{
			t++;
			if(t==2)
			{
				cout<<i-100<<endl;
				return 0;
			}

		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a[100];
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=1;i<n;i++)
        if(a[i]!=a[0]){
            cout<<a[i];
            return 0;
        }
    cout<<"NO";
    return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int a[10005]={0},n,k=2,i;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    for(i=1;i<=k&&i<=n;i++)
    {
        if(a[i]==a[i+1])
            k++;

    }
    if(i>n)
        cout<<"NO";
    else
        cout<<a[i-1]<<endl;
    return 0;
}


#include <iostream>
int a[101],n;
void wb(int left,int right)
{
	int i,j,t,temp;
	if(left>right)
	return;
	temp=a[left];
	i=left;
	j=right;
	while(i!=j)
	{
		while(a[j]>=temp&&i<j)
		j--;
		while(a[i]<=temp&&i<j)
		i++;
		if(i<j)
		{
			t=a[i];
			a[i]=a[j];
			a[j]=t;
		}
	}
	a[left]=a[i];
	a[i]=temp;
	wb(left,i-1);
	wb(i+1,right);
}
using namespace std;
int main()
{
	int i,j,t;
	cin>>n;
	for(i=1;i<=n;i++)
	cin>>a[i];
	wb(1,n);
	cout<<a[2];
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,x,a[105];
int main(){
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=2;i<=n;i++){
        if(a[i]!=a[i-1]){
            cout<<a[i]<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[10001];
int main()
{
	int k;
	cin>>k;
	for(int i=1;i<=k;i++)
		cin>>a[i];
	sort(a+1,a+1+k);
	for(int i=1;i<=k;i++)
	{
		if(a[i]!=a[i+1])
		{
			cout<<a[i+1];
			break;
		}
		if(i==k-1&&a[k-1]==a[k])
			cout<<"NO";
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[105];
    int n,maxa,maxx=0;
    scanf("%d",&n);
    if(n==1)
    {
        printf("NO");
        return 0;
    }
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        if(a[i]>maxx)
        {
            maxx=a[i];
        }
    }
    maxa=a[0];
    for(int j=1;j<n;j++)
    {
        if(a[j]<maxx && a[j]>maxa)
        {
            maxa=a[j];
        }
        if(a[j+1]==maxa)
        {
            printf("NO");
            return 0;
        }
    }
    printf("%d",maxa);
	return 0;
}


#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;
int book[105]={0};
int a[105];
int main()
{
	int n;
	cin>>n;
	int x;
	int wns=0;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	int minn=a[1];
	for(int i=2;i<=n;i++)
	{
		if(a[i]>minn)
		{
			cout<<a[i]<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[n+1],b[n+1],cnt=0;
    for(int i=1;i<=n;i++)
    {
    	cin>>a[i];
	}
	sort(a+1,a+n+1,greater<int>());
	for(int i=1;i<=n;i++)
	  if(a[i]!=a[i-1])
	  {
	  	cnt++;
	  	b[cnt]=a[i];
	  }
	  if(cnt<2)
	  {
	  	cout<<"NO"<<endl;
	  	return 0;
	  }
	cout<<b[2]<<endl;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int n;
int a[110];
int main()
{
    cin >> n;
    int b;
    for(int i=0;i<n;i++)
    {
        cin >>a[i];
    }
    sort(a,a+n);
      b=a[1];
    for(int i=0;a[i];i++)
    {
        if(b>a[i])
        {
            break;
        }
        if(b<a[i])
        {
            b=a[i];
            break;
        }
    }
    cout <<b<<endl;
}


#include<cstdio>
#include<iostream>

using namespace std;

int n;  int f=0;

int main()
{
	scanf("%d",&n);

	int m[n+1];

	for(int i=1;i<=n;i++)  scanf("%d",&m[i]);

	for(int i=n;i>=1;i--)  for(int j=1;j<=n-i;j++)  if(m[i]>m[i+1])  swap(m[i],m[i+1]);

	int t=m[1];

	for(int i=1;i<=n;i++)  if(i!=t&&i>t){f=1;printf("%d",i);break;}

	if(f!=1) printf("No");//for(int i=1;i<=n;i++)  cout<<m[i]<<" ";
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[105];
	int i,j,k;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	for(i=1;i<n;i++){
		if(a[i]!=a[0]){
			cout<<a[i]<<endl;
			return 0;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[101];
int main()
{
    int n,t;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a+0,a+n);
    for(int i=0;i<1001;i++)
    {
        if(a[i]!=a[i+1])
        {
        	cout<<a[i+1]<<" ";
            return 0;
        }
        else
    		i++;
    }
    cout<<"NO";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[105];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	int t=a[1];
	for(int i=1;i<=n;i++){
		if(a[i]>t){
			cout<<a[i];
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
bool cmp(int a,int b){
	return a<b;
}
int main(){
	int a;
	int c[200];
	scanf("%d",&a);
	for(int i=0;i<a;i++){
		scanf("%d",&c[i]);
	}
	sort(c,c+a,cmp);
	for(int i=1;i<a;i++){
		if(c[i]!=c[i-1]){
			printf("%d",c[i]);
			return 0;
		}
	}
	printf("NO");
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a,i;
	cin>>a;
	int m[a];
	for (i=0; i<a; i++)
		cin>>m[i];
	sort(m,m+a,greater<int>());
	for (i=0;;i++)
		if (m[i]!=m[i+1]) break;
	cout<<m[i+1];
	return 0;
}


#include<iostream>
using namespace std;
int n,a,cnr=0;
bool p[201];
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    while(n--)
    {
        cin>>a;
        p[a+100]++;
    }
    for(int i=0;i<=200;i++)
    {
        if(p[i])  cnr++;
        if(cnr==2)
        {
            cout<<i-100;
            return 0;
        }
    }
    cout<<"NO";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	int a[101];
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	if(n<2)
	{
		cout<<"NO";
		return 0;
	}
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++)
	{
		if(a[i]!=a[i+1])
		{
			cout<<a[i+1];
			return 0;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	int pd[101];
	cin>>n;
	for(int i=1; i<=n; i++) {
		cin>>pd[i];
	}
	sort(pd+1,pd+1+n);
	if(n==1) cout<<pd[1];
	else {
		for(int i=2; i<=n; i++) {
			if(pd[i]!=pd[1]) {
				cout<<pd[i];
				break;
			}
		}
	}
}


#include<iostream>
using namespace std;
int n,a,cnr=0,p[201];
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    while(n--)
    {
        cin>>a;
        p[a+100]++;
    }
    for(int i=0;i<=200;i++)
    {
        if(p[i])  cnr++;
        if(cnr==2)  {cout<<i-100;return 0;}
    }
    cout<<"NO";
    return 0;
}


#include<iostream>
using namespace std;
long long n,a[201],x,b[201],cnt;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
        cin>>x;
        x+=100;
        a[x]++;
    }
    for(int i=1;i<=200;i++)
    if(a[i]>=1)
    b[++cnt]=i-100;
    if(cnt-1>=1)
    cout<<b[cnt-1];
    else
    cout<<"NO";
    return 0;
}


#include<iostream>
using namespace std;
int a[2000];
int main()
{
    int n,xq=0,z;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>z;
        a[z+200]=1;
    }
    for(int i=0;i<=2000;i++)
    {
        if(a[i]==1)
        {
            xq++;
            if(xq==2)
            {
                cout<<i-200<<endl;
                return 0;
            }
        }
    }
    cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a[100],i;
int main()
{
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	sort(a,a+n);
	for(i=0;i<n-1;i++)
	{
		if(a[i]!=a[i+1])
		{
			cout<<a[i+1];
			return 0;
		}
	}
	if(i==n-1)
		cout<<"NO";
	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int arr[n];
    for(int i = 0; i < n; i++)
    {
        cin >> arr[i];
    }
    sort(arr, arr + n);
    if(unique(arr, arr + n) - arr < 2)
    {
        cout << "NO\n";
    }
    else
    {
        cout << arr[1] << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[n+5];
	for(int i=1;i<=n;i++)
		cin>>a[i];
	sort(a+1,a+n+1);
	int flag=0;
	for(int i=1;i<=n;i++){
		if(a[i]!=a[i-1])
			flag++;
		if(flag==2){
			cout<<a[i];
			return 0;
		}
	}
}


#include <bits/stdc++.h>
using namespace std;
int mi1=INT_MAX,mi2=INT_MAX,n;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		int t;
		cin>>t;
		if(t<mi1)
			mi1=t;
		else if(t!=mi1&&t<mi2)
			mi2=t;
	}
	cout<<mi2;
	return 0;
}


#include<iostream>
#include<cstdio>

using namespace std;

int n;  int m;  int t[201];  int s=0;

int main()
{
	scanf("%d",&n);

	for(int i=1;i<=n;i++)
	{
		scanf("%d",&m);

		t[m+100]++;
	}

	for(int i=1;i<=200;i++)
	{
		if(t[i]) s++;
		if(s==2)
		{
		    printf("%d",i-100); return 0;//cout<<i-100;
		}
	}

	printf("NO");  return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a[110];
int main(){
    cin>>n;
    for(int i=0;i<n;++i) cin>>a[i];
    sort(a,a+n);
    int ma=a[n-1];
    for(int i=n-1;i>=0;--i){
    	if(a[i]!=ma){
    		cout<<a[i]<<endl;
    		return 0;
		}
	}
	cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a[500];
int main()
{
	cin>>n;
	for(int x=1;x<=n;x++)cin>>a[x];
	sort(a+1,a+n+1);
	cout<<a[2];
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{   int a,n,b1,b2;
    cin>>a;
    cin>>n;
    b1=b2=n;
    for(int i=2;i<=a;i++)
    {
    	cin>>n;
    	if(n<b1)
    	{
    		b2=b1;
    		b1=n;
		}
		else
		{
			if(n<b2)
			b2=n;
		}
	}
	cout<<b2;

	 return 0;
 }


#include<bits/stdc++.h>
using namespace std;
int n,a[200];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int x;
		cin>>x;
		a[x+100]=1;
	}
	int t=0;
	for(int i=0;i<=200;i++)
	{
		if(a[i]!=0)
		{
			t++;
			if(t==2)
			{
				cout<<i-100<<endl;
				return 0;
			}

		}
	}
	cout<<"NO"<<endl;
	return 0;
}


#include<cstdio>
#include<algorithm>
using namespace std;
int a[120];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	sort(a,a+n);
	printf("%d",a[1]);
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int a,m[1000],MAXN=-1e9,MAXN2=-1e9;
int main(){
	cin>>a;
	for(int i=1;i<=a;i++){
		cin>>m[i];
		if(m[i]>MAXN)MAXN=m[i];
	}
	sort(m+1,m+a+1);
	for(int i=a;i>=1;i--)if(m[i]!=MAXN){MAXN2=m[i];break;}
	cout<<MAXN2<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int a[1001];
int main()
{
	int n,x=0;
	cin>>n;
	for(int i=0;i<n;i++)
	cin>>a[i];
	sort(a,a+n);
	for(int i=1;i<n;i++)
	{
		if(a[i]!=a[i-1])
		{
			cout<<a[i];
			x++;
			break;
		}
	}
	if(x==0) cout<<a[0];
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
int a[MAXN], n;
int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    sort(a + 1, a + n + 1);
    for (int i = 2; i <= n; i++)
        if (a[i] != a[i - 1])
			cout << a[i] << endl, return 0;
    cout << "NO" << endl;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int a[100000],b[100000];
int main
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    stable_sort(a,a+n);
    for(int i=0;i<n;i++)
    {
        b[abs(a[i])]++;
    }
    for(int i=0;i<n;i++)
    {
        cout<<b[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[10001];
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	sort(a+1,a+n+1);
	for(int i=2;i<=n;i++)
		if(a[i]!=a[i-1])
		{
			cout<<a[i];
			return 0;
		}
		cout<<"NO";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[101],m;
int main(){
    cin>>m;
    for(int i=1;i<=m;i++){
        cin>>a[i];
    }sort(a+1,a+m+1);
    cout<<a[2];
    return 0;
}


#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<iomanip>
using namespace std;
int main(){
	int n,a[110],mas=100000000,mass=100000000;
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++)if(a[i]<mas&&a[i]>=0)mas=a[i];
	for(int i=1;i<=n;i++)if(a[i]==mas)a[i]==10000000;
	for(int i=1;i<=n;i++)if(a[i]<mass&&a[i]>=0)mass=a[i];
	cout<<mass;
	return 0;
}


#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
int n,a[1000],m;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1);
	m=a[1];
	for(int i=2;i<=n;i++)
	{
		if(a[i]!=m)
		{
			cout<<a[i];
			return 0;
		}
	}
	cout<<"NO"<<endl;
	return 0;
}


#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
    int i,j,tong[1000],a[101],n,c=1;
    cin>>n;
    memset(tong,0,sizeof(tong));
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
        tong[a[i]+101]++;

    }

    for(i=1;i<=202;i++)
    {
        if(tong[i]!=0)
        {
            if(c==1)
            c++;
            else
                {cout<<i-101;
                return 0;
                }

        }
    }
    cout<<"NO";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a[101];
int main()
{
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a,a+n);
	int max=a[0];
	for(int i=0;i<n;i++){
		if(a[i]>max){
			cout<<a[i];
			return 0;
		}
	}return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,min=2147483647,min2=2147483646;
	cin>>n;
	int a[132145];
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]<min)
			min=a[i];
	}
	for(int i=1;i<=n;i++)
	{
		if(a[i]!=min&&a[i]<min2)
			min2=a[i];
	}
	if(min2==2147483646)
	{
		cout<<"NO";
		return 0;
	}
	cout<<min2;
	return 0;

 }


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int second,first = -101;
    int x;
    cin >> x;
    second = first = x;
    for(int i = 1;i < n;i ++)
    {
        cin >> x;
        if(x > first)
        {
            second = first;
            first = x;
        }
    }
    if(second == first)
    {
        cout << "NO";
        return 0;
    }
    cout << second;
}


#include<cstdio>
#include<cctype>
#include<algorithm>
#define ri register int
using namespace std;
template<class code>inline code read(const code &a)
{
    code x=0;short w=0;char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) {x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
    return w?-x:x;
}
int n,a[105];
int main()
{
	n=read(n);
	for (ri i=1;i<=n;++i) a[i]=read(a[i]);
	sort(a+1,a+n+1);
	if (n>2&&a[2]>a[1]&&a[2]<a[3]) printf("%d\n",a[2]);
	else printf("NO\n");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int x[1000001];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;++i)
	{
		cin>>x[i];
	 }
	sort(x,x+n);
	for(int i=1;i<=n;++i)
	{
		if(x[i]>x[1)
		{
			cout<<x[i];
			return 0;
		}
	}
	cout<<"NO";
}


#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int n, i, m, a[105];
	cin >> n;
	for(int i = 1; i <= n; i++)
	cin >> a[i];
	sort(a + 1, a + n + 1);
	i = 1;
	m = a[1];
	while(i < n) {
		i++;
		if(a[i] != m) {
			cout << a[i] << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,s,a[105];
bool ok=0;
int main(){
	cin>>n;
	for (int i=0;i<n;i++)
	    cin>>a[i];
	sort (a,a+n);
	if (a[0]==a[n-1]){ cout<<"NO"; return 0;}
	int s=0;
	while (a[s]==a[s+1])
	   s++;
	cout<<a[s+1];
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[100001];
int main() {
	int n,x;
	cin>>n;
	for(int i=1; i<=n; i++) {
		cin>>a[i];
	}
	sort(a+1,a+n+1);
	for(int i=2; i<=n; i++) {
		if(a[i]!=a[i-1]) {
			cout<<a[i]<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
	return 0;
}


#include <bits/stdc++.h>
int n, a[105], x, cnt = 0;
int used[215];
int main(){
    memset(a,0x3f,sizeof(a));
    scanf("%d",&n);
    for(int i = 0; i < n; i++) {
        scanf("%d", &x);
        if(*(used + x + 100)) continue;
        *(used + x + 100) = 1;
        *(a + i) = x;
        ++cnt;
    }
    std::sort(a, a + n);
    //for(int i = 0; i < n; i++) printf("%d ", *(a+i));
    if(cnt >= 2) printf("%d",*(a + 1));
    else printf("NO");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int a[200],n;
int main()
{
	//[CF22A]Second Order Statistics
	int n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	int l=unique(a+1,a+n+1)-a;
	if (l>1) printf("%d",a[2]);
	else printf("NO");
}


#include<bits/stdc++.h>
using namespace std;
int n,a[101],t,i;
int main()
{
	cin>>n;
	for(i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+n+1);
	t=a[1];
	for(i=1;i<=n;i++)
	if(a[i]!=t)
	{
	cout<<a[i];
	return 0;
	}
	cout<<"NO";
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a,i,n=0;
	cin>>a;
	int m[a];
	for (i=0; i<a; i++)
		cin>>m[i];
	sort(m,m+a,greater<int>());
	for (i=1;i<a;i++)
		if (m[i]!=m[i-1]){n=1;break;}
	if (n==1)
	cout<<m[i+1]<<endl;
	else
	cout<<"NO\n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[101],n;
int main(){
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
		cin>>a[i];
    sort(a+1,a+n+1);
    if (n<=1){
    	cout<<"NO"<<endl;
	}
	for(int i=1,ans=0;i<=n;i++){
		if(a[i]!=a[i-1])
			ans++;
		if(ans==2){
			cout<<a[i]<<endl;
			return 0;
		}
	}
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#define re register int
using namespace std;
int n,a[101],mins;
int main()
{
    scanf("%d",&n);
    for(re i=1;i<=n;i++)
        scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    mins=a[1];
    int k=1;
    while(k<n)
    {
        k++;
        if(a[k]!=mins)
        {
            printf("%d",a[k]);
            return 0;
        }
    }
    printf("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[10001],n;
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	sort(a+1,a+n+1);
	for(int i=2;i<=n;i++)
		if(a[i]!=a[i-1])
		{
			cout<<a[i];
			return 0;
		}
	cout<<"NO";
    return 0;
}