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

public class Codeforces
{
    public static void process()throws IOException
    {
        int n=ni(),i,k=0,c[]=new int[5001];
        for(i=0;i<n;i++)
        {
            k=ni();
            c[k]++;
        }
        int ans=Integer.MAX_VALUE;
        for(i=1;i<=5000;i++)
            c[i]+=c[i-1];
        for(i=1;i<=2500;i++)
            ans=Math.min(ans,n-(c[2*i]-c[i-1]));
        pn(ans);
    }

    static FastReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        String ip="input.txt", op="output.txt";
        sc=new FastReader(ip,op);
        out=sc.op();
        process();
        out.flush();
    }

    static void pn(Object o){ out.println(o); }
    static int ni()throws IOException{ return Integer.parseInt(sc.next()); }

    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        PrintWriter out;

        public FastReader()throws IOException
        {
            br=new BufferedReader(new InputStreamReader(System.in));
            out=new PrintWriter(System.out);
        }

        public FastReader(String in_file, String out_file)throws FileNotFoundException{
            br=new BufferedReader(new FileReader(in_file));
            out=new PrintWriter(out_file);
        }

        PrintWriter op()
        {
            return out;
        }

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

    }
}


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

public class Codeforces
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int i,c[]=new int[5001],k;
        for(i=0;i<n;i++)
        {
            k=Integer.parseInt(s[i]);
            c[k]++;
        }
        int ans=Integer.MAX_VALUE;
        for(i=1;i<=5000;i++)
        c[i]+=c[i-1];
        for(i=1;i<=2500;i++)
        ans=Math.min(ans,n-(c[2*i]-c[i-1]));
        System.out.print(ans);
    }
}


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

public class Codeforces
{
    public static void main(String args[])throws Exception
    {
        File f=new File("input.txt");
        FileWriter f2=new FileWriter("output.txt");
        BufferedReader bu=new BufferedReader(new FileReader(f));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int i,c[]=new int[5001],k;
        for(i=0;i<n;i++)
        {
            k=Integer.parseInt(s[i]);
            c[k]++;
        }
        int ans=Integer.MAX_VALUE;
        for(i=1;i<=5000;i++)
        c[i]+=c[i-1];
        for(i=1;i<=2500;i++)
        ans=Math.min(ans,n-(c[2*i]-c[i-1]));
        PrintWriter p=new PrintWriter(f2);
        p.println(ans+"\n");
    }
}


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

public class Codeforces
{
    public static void main(String args[])throws Exception
    {
        File f=new File("input.txt");
        BufferedReader bu=new BufferedReader(new FileReader(f));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int i,c[]=new int[5001],k;
        for(i=0;i<n;i++)
        {
            k=Integer.parseInt(s[i]);
            c[k]++;
        }
        int ans=Integer.MAX_VALUE;
        for(i=1;i<=5000;i++)
        c[i]+=c[i-1];
        for(i=1;i<=2500;i++)
        ans=Math.min(ans,n-(c[2*i]-c[i-1]));
        PrintWriter p=new PrintWriter("output.txt");
        p.println(ans);
    }
}


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

public class Codeforces
{
    public static void main(String args[])throws Exception
    {
        FastReader fr=new FastReader("input.txt","output.txt");
        int n=ni();
        int i,c[]=new int[5001],k;
        for(i=0;i<n;i++)
        {
            k=ni();
            c[k]++;
        }
        int ans=Integer.MAX_VALUE;
        for(i=1;i<=5000;i++)
        c[i]+=c[i-1];
        for(i=1;i<=2500;i++)
        ans=Math.min(ans,n-(c[2*i]-c[i-1]));
        out=fr.op();
        pn(ans);
        out.flush();
    }
    static FastReader sc;
    static PrintWriter out;

    static void pn(Object o){ out.println(o); }
    static int ni()throws IOException{ return Integer.parseInt(sc.next()); }

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        PrintWriter out;

        public FastReader(String in_file, String out_file)throws FileNotFoundException
        {
            br=new BufferedReader(new FileReader(in_file));
            out=new PrintWriter(out_file);
        }

        PrintWriter op()
        {
            return out;
        }

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

    }
}


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

public class Codeforces
{
    public static void main(String args[])throws Exception
    {
        File f=new File("input.txt");
        BufferedReader bu=new BufferedReader(new FileReader(f));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int i,c[]=new int[5001],k;
        for(i=0;i<n;i++)
        {
            k=Integer.parseInt(s[i]);
            c[k]++;
        }
        int ans=Integer.MAX_VALUE;
        for(i=1;i<=5000;i++)
        c[i]+=c[i-1];
        for(i=1;i<=2500;i++)
        ans=Math.min(ans,n-(c[2*i]-c[i-1]));
        PrintWriter p=new PrintWriter("output.txt");
        Integer in=ans;
        p.println(in);
    }
}


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

public class Codeforces
{
    public static void main(String args[])throws Exception
    {
        File f=new File("input.txt");
        BufferedReader bu=new BufferedReader(new FileReader(f));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int i,c[]=new int[5001],k;
        for(i=0;i<n;i++)
        {
            k=Integer.parseInt(s[i]);
            c[k]++;
        }
        int ans=Integer.MAX_VALUE;
        for(i=1;i<=5000;i++)
        c[i]+=c[i-1];
        for(i=1;i<=2500;i++)
        ans=Math.min(ans,n-(c[2*i]-c[i-1]));
        PrintWriter p=new PrintWriter("output.txt");
        p.println(ans+"\n");
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Random;

public class Solution1 {

    public static void main(String[] args) throws IOException {
        try (PrintWriter out = new PrintWriter(Files.newBufferedWriter(Paths.get("output.txt")))) {
            _Scanner sc = new _Scanner(Files.newInputStream(Paths.get("input.txt")));

            int n = sc.nextInt();
            int[] vs = new int[n];
            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            int ret = n;
            for (int i = 0; i < vs.length; i++) {
                int a = i;
                for (int step = vs.length - a - 1; step > 0; step /= 2) {
                    while (a + step < vs.length && vs[i] * 2 >= vs[a + step]) a += step;
                }
                ret = Math.min(ret, n - (a - i + 1));
            }

            out.println(ret);
        }
    }

    private static void reverse(int[] vs) {
        for (int i = 0; i < vs.length / 2; i++) {
            swap(vs, i, vs.length - 1 - i);
        }
    }

    static class _Scanner {
        InputStream is;
        _Scanner(InputStream is) {
            this.is = is;
        }
        byte[] bb = new byte[1 << 15];
        int k, l;
        byte getc() {
            try {
                if (k >= l) {
                    k = 0;
                    l = is.read(bb);
                    if (l < 0) return -1;
                }
                return bb[k++];
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        byte skip() {
            byte b;
            while ((b = getc()) <= 32)
                ;
            return b;
        }

        int nextInt() {
            int n = 0;
            int sig = 1;
            for (byte b = skip(); b > 32; b = getc()) {
                if (b == '-') {
                    sig = -1;
                } else {
                    n = n * 10 + b - '0';
                }
            }
            return sig * n;
        }

        long nextLong() {
            long n = 0;
            long sig = 1;
            for (byte b = skip(); b > 32; b = getc()) {
                if (b == '-') {
                    sig = -1;
                } else {
                    n = n * 10 + b - '0';
                }
            }
            return sig * n;
        }

        public String next() {
            StringBuilder sb = new StringBuilder();
            for (int b = skip(); b > 32; b = getc()) {
                sb.append(((char) b));
            }
            return sb.toString();
        }
    }

    private static void shuffle(int[] ar) {
        Random rnd = new Random();
        for (int i = 0; i < ar.length; i++) {
            int j = i + rnd.nextInt(ar.length - i);
            swap(ar, i, j);
        }
    }

    private static void shuffle(Object[] ar) {
        Random rnd = new Random();
        for (int i = 0; i < ar.length; i++) {
            int j = i + rnd.nextInt(ar.length - i);
            swap(ar, i, j);
        }
    }

    private static void swap(int[] ar, int i, int j) {
        int t = ar[i];
        ar[i] = ar[j];
        ar[j] = t;
    }

    private static void swap(Object[] ar, int i, int j) {
        Object t = ar[i];
        ar[i] = ar[j];
        ar[j] = t;
    }

}


/* package codechef; // don't place package name! */

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

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 int a[]=new int[n];
	 for(int i=0;i<n;i++){a[i]=sc.nextInt();}
	 Arrays.sort(a);
	 int min=Integer.MAX_VALUE;
	 for(int i=0;i<n;i++){
	     int cidx=0;int low=0,high=n-1;
	     while(low<=high){
	         int mid=low+(high-low)/2;
	         if(a[mid]<=2*a[i]){cidx=mid;low=mid+1;}
	         else high=mid-1;
	     }
	     min=Math.min(min,i+n-1-cidx);
	 }

	 System.out.println(min);
	}
}


/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 int a[]=new int[n];
	 for(int i=0;i<n;i++){a[i]=sc.nextInt();}
	 Arrays.sort(a);
	 int min=Integer.MAX_VALUE;
	 for(int i=0;i<n;i++){
	     int cidx=0;int low=0,high=n-1;
	     while(low<=high){
	         int mid=low+(high-low)/2;
	         if(a[mid]<=2*a[i]){cidx=mid;low=mid+1;}
	         else high=mid-1;
	     }
	     min=Math.min(min,i+n-1-cidx);
	 }

	 System.out.println(min);
	}
}


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

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 File in=new File("input.txt");
     Writer wr=new FileWriter("output.txt");
	 Scanner sc=new Scanner(in);
	 int n=sc.nextInt();
	 int a[]=new int[n];
	 for(int i=0;i<n;i++){a[i]=sc.nextInt();}
	 Arrays.sort(a);
	 int min=Integer.MAX_VALUE;
	 for(int i=0;i<n;i++){
	     int cidx=0;int low=0,high=n-1;
	     while(low<=high){
	         int mid=low+(high-low)/2;
	         if(a[mid]<=2*a[i]){cidx=mid;low=mid+1;}
	         else high=mid-1;
	     }
	     min=Math.min(min,i+n-1-cidx);
	 }

	wr.write(min+" ");
    //wr.write(0+" ");
    wr.flush();
    wr.close();
	}
}


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

public class Main
{

    public static void process()throws IOException
    {
    	int n=ni(),arr[]=new int[n+1];
    	for(int i=1;i<=n;i++) arr[i]=ni();
    	r_sort(arr,n+1);

    	int res=Integer.MAX_VALUE,l,r,mid;

    	for(int i=n;i>=1;i--){//assume arr[i] is largest
    		l=1;
    		r=n-1;

    		while(l<=r){
    			mid=l+(r-l)/2;

    			if(arr[i]<=2*arr[mid]){
    				res=Math.min(res,n-i+mid-1);
    				r=mid-1;
    			}
    			else
    				l=mid+1;
    		}
    	}
    	pn(res);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

    	oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
		//t=ni();
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


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

public class Main
{

    public static void process()throws IOException
    {
    	int n=ni(),arr[]=new int[n+1];
    	for(int i=1;i<=n;i++) arr[i]=ni();
    	r_sort(arr,n+1);

    	int res=Integer.MAX_VALUE,l,r,mid;

    	for(int i=n;i>=1;i--){//assume arr[i] is largest
    		l=1;
    		r=i-1;

    		while(l<=r){
    			mid=l+(r-l)/2;

    			if(arr[i]<=2*arr[mid]){
    				res=Math.min(res,n-i+mid-1);
    				r=mid-1;
    			}
    			else
    				l=mid+1;
    		}
    	}
    	pn(res==Integer.MAX_VALUE?1:res);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter("output.txt");
        sc=new AnotherReader(100);

        process();
        out.flush();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


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

public class Main
{

    public static void process()throws IOException
    {
    	int n=ni(),arr[]=new int[n+1];
    	for(int i=1;i<=n;i++) arr[i]=ni();
    	r_sort(arr,n+1);

    	int res=Integer.MAX_VALUE,l,r,mid;

    	for(int i=n;i>=1;i--){//assume arr[i] is largest
    		l=1;
    		r=i-1;

    		while(l<=r){
    			mid=l+(r-l)/2;

    			if(arr[i]<=2*arr[mid]){
    				res=Math.min(res,n-i+mid-1);
    				r=mid-1;
    			}
    			else
    				l=mid+1;
    		}
    	}
    	pn(res);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter("output.txt");
        sc=new AnotherReader(100);

        process();
        out.flush();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


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

public class Main
{

    public static void process()throws IOException
    {
    	int n=ni(),arr[]=new int[n+1];
    	for(int i=1;i<=n;i++) arr[i]=ni();
    	r_sort(arr,n+1);

    	int res=Integer.MAX_VALUE,l,r,mid;

    	for(int i=n;i>=1;i--){//assume arr[i] is largest
    		l=1;
    		r=i-1;

    		while(l<=r){
    			mid=l+(r-l)/2;

    			if(arr[i]<=2*arr[mid]){
    				res=Math.min(res,n-i+mid-1);
    				r=mid-1;
    			}
    			else
    				l=mid+1;
    		}
    	}
    	pn(res);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

    	oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
		//t=ni();
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


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

        public class Main implements Runnable
        {
            static class InputReader
            {
                private InputStream stream;
                private byte[] buf = new byte[1024];
                private int curChar;
                private int numChars;
                private SpaceCharFilter filter;
                private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

                public InputReader(InputStream stream)
                {
                    this.stream = stream;
                }

                public int read()
                {
                    if (numChars==-1)
                        throw new InputMismatchException();

                    if (curChar >= numChars)
                    {
                        curChar = 0;
                        try
                        {
                            numChars = stream.read(buf);
                        }
                        catch (IOException e)
                        {
                            throw new InputMismatchException();
                        }

                        if(numChars <= 0)
                            return -1;
                    }
                    return buf[curChar++];
                }

                public String nextLine()
                {
                    String str = "";
                    try
                    {
                        str = br.readLine();
                    }
                    catch (IOException e)
                    {
                        e.printStackTrace();
                    }
                    return str;
                }
                public int nextInt()
                {
                    int c = read();

                    while(isSpaceChar(c))
                        c = read();

                    int sgn = 1;

                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }

                    int res = 0;
                    do
                    {
                        if(c<'0'||c>'9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res * sgn;
                }

                public long nextLong()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    long res = 0;

                    do
                    {
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));
                        return res * sgn;
                }

                public double nextDouble()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    double res = 0;
                    while (!isSpaceChar(c) && c != '.')
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    if (c == '.')
                    {
                        c = read();
                        double m = 1;
                        while (!isSpaceChar(c))
                        {
                            if (c == 'e' || c == 'E')
                                return res * Math.pow(10, nextInt());
                            if (c < '0' || c > '9')
                                throw new InputMismatchException();
                            m /= 10;
                            res += (c - '0') * m;
                            c = read();
                        }
                    }
                    return res * sgn;
                }

                public String readString()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    StringBuilder res = new StringBuilder();
                    do
                    {
                        res.appendCodePoint(c);
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res.toString();
                }

                public boolean isSpaceChar(int c)
                {
                    if (filter != null)
                        return filter.isSpaceChar(c);
                    return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
                }

                public String next()
                {
                    return readString();
                }

                public interface SpaceCharFilter
                {
                    public boolean isSpaceChar(int ch);
                }
            }
            public static void main(String args[]) throws Exception
            {
                new Thread(null, new Main(),"Main",1<<27).start();
            }

            static class Pair{
                int f;
                int s;
                //boolean n;

                Pair(int f,int s){
                    this.f=f;
                    this.s=s;
                    //this.n = n;

                }

                public static Comparator<Pair> wc = new Comparator<Pair>(){
                    public int compare(Pair e1,Pair e2){

                        //reverse order
                        //if(e1.n)return 1;
                        //else if(e2.n) return -1;
                        if(e1.s < e2.s)
                            return -1;  // 1 for swaping.
                        else if (e1.s > e2.s)
                            return 1;
                        else {
                            return 0;
                        }

                    }
                };
            }

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

            ////recursive BFS
            public static int bfsr(int s,ArrayList<Integer>[] a,boolean[] b,int[] pre){
                b[s]=true;
                int p = 1;
                int n = pre.length -1;
                int t = a[s].size();
                int max = 1;
                for(int i=0;i<t;i++){
                    int x = a[s].get(i);
                    if(!b[x]){
                        //dist[x] = dist[s] + 1;
                        int xz =  (bfsr(x,a,b,pre));
                        p+=xz;
                        max = Math.max(xz,max);
                    }
                }
                //max = Math.max(max,(n-p));
                pre[s] = max;
                return p;
            }

        //// iterative BFS
            public static int bfs(int s,ArrayList<Integer>[] a,int dist,boolean[] b,PrintWriter w){
                b[s]=true;
                int siz = 0;
                dist--;
                Queue<Integer> q = new LinkedList<>();
                q.add(s);
                while(q.size()!=0 && dist>0 ){
                    int i=q.poll();
                    Iterator<Integer> it = a[i].listIterator();
                    int z=0;
                    while(it.hasNext() && dist>0){
                        z=it.next();
                        if(!b[z]){
                            b[z]=true;
                            dist--;
                            //dist[z] = dist[i] + 1;
                            siz++;
                            q.add(z);
                        }
                    }

                }
                return siz;
            }

            public static int lower(int key, Integer[] a){
                int l = 0;
                int r = a.length-1;
                int res = 0;

                while(l<=r){
                    int mid = (l+r)/2;

                    if(a[mid]<=key){
                        l = mid+1;
                        res = mid+1;
                    }
                    else{
                        r = mid -1;
                    }
                }

                return res;
            }

        //////////////////////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////////////////////

            public void run()
            {
                InputReader sc = new InputReader(System.in);
                PrintWriter w = new PrintWriter(System.out);
                long defaultValue=0;

                // int tc = sc.nextInt();
                // while(tc-->0){
                    int n = sc.nextInt();
                    Integer[] a = new Integer[n];
                    for(int i=0;i<n;i++)a[i] = sc.nextInt();
                    Arrays.sort(a);
                    long min = Long.MAX_VALUE;

                    for(int i=0;i<n;i++){
                        int z = lower((a[i]*2), a);
                        long diff = (n-z+i);
                        if(z<n && a[z]<=(a[i]*2))diff--;
                        if(diff<min){
                            min = diff;
                            //w.println(i+" "+z);
                        }
                    }
                    w.print(min);

                //}
                w.flush();
                w.close();
            }

        }


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

        public class Main implements Runnable
        {
            static class InputReader
            {
                private InputStream stream;
                private byte[] buf = new byte[1024];
                private int curChar;
                private int numChars;
                private SpaceCharFilter filter;
                private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

                public InputReader(InputStream stream)
                {
                    this.stream = stream;
                }

                public int read()
                {
                    if (numChars==-1)
                        throw new InputMismatchException();

                    if (curChar >= numChars)
                    {
                        curChar = 0;
                        try
                        {
                            numChars = stream.read(buf);
                        }
                        catch (IOException e)
                        {
                            throw new InputMismatchException();
                        }

                        if(numChars <= 0)
                            return -1;
                    }
                    return buf[curChar++];
                }

                public String nextLine()
                {
                    String str = "";
                    try
                    {
                        str = br.readLine();
                    }
                    catch (IOException e)
                    {
                        e.printStackTrace();
                    }
                    return str;
                }
                public int nextInt()
                {
                    int c = read();

                    while(isSpaceChar(c))
                        c = read();

                    int sgn = 1;

                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }

                    int res = 0;
                    do
                    {
                        if(c<'0'||c>'9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res * sgn;
                }

                public long nextLong()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    long res = 0;

                    do
                    {
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));
                        return res * sgn;
                }

                public double nextDouble()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    double res = 0;
                    while (!isSpaceChar(c) && c != '.')
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    if (c == '.')
                    {
                        c = read();
                        double m = 1;
                        while (!isSpaceChar(c))
                        {
                            if (c == 'e' || c == 'E')
                                return res * Math.pow(10, nextInt());
                            if (c < '0' || c > '9')
                                throw new InputMismatchException();
                            m /= 10;
                            res += (c - '0') * m;
                            c = read();
                        }
                    }
                    return res * sgn;
                }

                public String readString()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    StringBuilder res = new StringBuilder();
                    do
                    {
                        res.appendCodePoint(c);
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res.toString();
                }

                public boolean isSpaceChar(int c)
                {
                    if (filter != null)
                        return filter.isSpaceChar(c);
                    return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
                }

                public String next()
                {
                    return readString();
                }

                public interface SpaceCharFilter
                {
                    public boolean isSpaceChar(int ch);
                }
            }
            public static void main(String args[]) throws Exception
            {
                new Thread(null, new Main(),"Main",1<<27).start();
            }

            static class Pair{
                int f;
                int s;
                //boolean n;

                Pair(int f,int s){
                    this.f=f;
                    this.s=s;
                    //this.n = n;

                }

                public static Comparator<Pair> wc = new Comparator<Pair>(){
                    public int compare(Pair e1,Pair e2){

                        //reverse order
                        //if(e1.n)return 1;
                        //else if(e2.n) return -1;
                        if(e1.s < e2.s)
                            return -1;  // 1 for swaping.
                        else if (e1.s > e2.s)
                            return 1;
                        else {
                            return 0;
                        }

                    }
                };
            }

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

            ////recursive BFS
            public static int bfsr(int s,ArrayList<Integer>[] a,boolean[] b,int[] pre){
                b[s]=true;
                int p = 1;
                int n = pre.length -1;
                int t = a[s].size();
                int max = 1;
                for(int i=0;i<t;i++){
                    int x = a[s].get(i);
                    if(!b[x]){
                        //dist[x] = dist[s] + 1;
                        int xz =  (bfsr(x,a,b,pre));
                        p+=xz;
                        max = Math.max(xz,max);
                    }
                }
                //max = Math.max(max,(n-p));
                pre[s] = max;
                return p;
            }

        //// iterative BFS
            public static int bfs(int s,ArrayList<Integer>[] a,int dist,boolean[] b,PrintWriter w){
                b[s]=true;
                int siz = 0;
                dist--;
                Queue<Integer> q = new LinkedList<>();
                q.add(s);
                while(q.size()!=0 && dist>0 ){
                    int i=q.poll();
                    Iterator<Integer> it = a[i].listIterator();
                    int z=0;
                    while(it.hasNext() && dist>0){
                        z=it.next();
                        if(!b[z]){
                            b[z]=true;
                            dist--;
                            //dist[z] = dist[i] + 1;
                            siz++;
                            q.add(z);
                        }
                    }

                }
                return siz;
            }

            public static int lower(int key, Integer[] a){
                int l = 0;
                int r = a.length-1;
                int res = 0;

                while(l<=r){
                    int mid = (l+r)/2;

                    if(a[mid]<=key){
                        l = mid+1;
                        res = mid+1;
                    }
                    else{
                        r = mid -1;
                    }
                }

                return res;
            }

        //////////////////////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////////////////////

            public void run()
            {
                InputReader sc = new InputReader(System.in);
                PrintWriter w = new PrintWriter(System.out);
                long defaultValue=0;

                // int tc = sc.nextInt();
                // while(tc-->0){
                    int n = sc.nextInt();
                    Integer[] a = new Integer[n];
                    for(int i=0;i<n;i++)a[i] = sc.nextInt();
                    Arrays.sort(a);
                    long min = Long.MAX_VALUE;

                    for(int i=0;i<n;i++){
                        int z = lower((a[i]*2), a);
                        long diff = (n-z+i);
                        if(z<n && a[z]<=(a[i]*2))diff--;
                        if(diff<min){
                            min = diff;
                            //w.println(i+" "+z);
                        }
                    }
                    w.println(min);

                //}
                w.flush();
                w.close();
            }

        }


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

        public class Main implements Runnable
        {
            static class InputReader
            {
                private InputStream stream;
                private byte[] buf = new byte[1024];
                private int curChar;
                private int numChars;
                private SpaceCharFilter filter;
                private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

                public InputReader(InputStream stream)
                {
                    this.stream = stream;
                }

                public int read()
                {
                    if (numChars==-1)
                        throw new InputMismatchException();

                    if (curChar >= numChars)
                    {
                        curChar = 0;
                        try
                        {
                            numChars = stream.read(buf);
                        }
                        catch (IOException e)
                        {
                            throw new InputMismatchException();
                        }

                        if(numChars <= 0)
                            return -1;
                    }
                    return buf[curChar++];
                }

                public String nextLine()
                {
                    String str = "";
                    try
                    {
                        str = br.readLine();
                    }
                    catch (IOException e)
                    {
                        e.printStackTrace();
                    }
                    return str;
                }
                public int nextInt()
                {
                    int c = read();

                    while(isSpaceChar(c))
                        c = read();

                    int sgn = 1;

                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }

                    int res = 0;
                    do
                    {
                        if(c<'0'||c>'9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res * sgn;
                }

                public long nextLong()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    long res = 0;

                    do
                    {
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    while (!isSpaceChar(c));
                        return res * sgn;
                }

                public double nextDouble()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    int sgn = 1;
                    if (c == '-')
                    {
                        sgn = -1;
                        c = read();
                    }
                    double res = 0;
                    while (!isSpaceChar(c) && c != '.')
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                    }
                    if (c == '.')
                    {
                        c = read();
                        double m = 1;
                        while (!isSpaceChar(c))
                        {
                            if (c == 'e' || c == 'E')
                                return res * Math.pow(10, nextInt());
                            if (c < '0' || c > '9')
                                throw new InputMismatchException();
                            m /= 10;
                            res += (c - '0') * m;
                            c = read();
                        }
                    }
                    return res * sgn;
                }

                public String readString()
                {
                    int c = read();
                    while (isSpaceChar(c))
                        c = read();
                    StringBuilder res = new StringBuilder();
                    do
                    {
                        res.appendCodePoint(c);
                        c = read();
                    }
                    while (!isSpaceChar(c));

                    return res.toString();
                }

                public boolean isSpaceChar(int c)
                {
                    if (filter != null)
                        return filter.isSpaceChar(c);
                    return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
                }

                public String next()
                {
                    return readString();
                }

                public interface SpaceCharFilter
                {
                    public boolean isSpaceChar(int ch);
                }
            }
            public static void main(String args[]) throws Exception
            {
                new Thread(null, new Main(),"Main",1<<27).start();
            }

            static class Pair{
                int f;
                int s;
                //boolean n;

                Pair(int f,int s){
                    this.f=f;
                    this.s=s;
                    //this.n = n;

                }

                public static Comparator<Pair> wc = new Comparator<Pair>(){
                    public int compare(Pair e1,Pair e2){

                        //reverse order
                        //if(e1.n)return 1;
                        //else if(e2.n) return -1;
                        if(e1.s < e2.s)
                            return -1;  // 1 for swaping.
                        else if (e1.s > e2.s)
                            return 1;
                        else {
                            return 0;
                        }

                    }
                };
            }

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

            ////recursive BFS
            public static int bfsr(int s,ArrayList<Integer>[] a,boolean[] b,int[] pre){
                b[s]=true;
                int p = 1;
                int n = pre.length -1;
                int t = a[s].size();
                int max = 1;
                for(int i=0;i<t;i++){
                    int x = a[s].get(i);
                    if(!b[x]){
                        //dist[x] = dist[s] + 1;
                        int xz =  (bfsr(x,a,b,pre));
                        p+=xz;
                        max = Math.max(xz,max);
                    }
                }
                //max = Math.max(max,(n-p));
                pre[s] = max;
                return p;
            }

        //// iterative BFS
            public static int bfs(int s,ArrayList<Integer>[] a,int dist,boolean[] b,PrintWriter w){
                b[s]=true;
                int siz = 0;
                dist--;
                Queue<Integer> q = new LinkedList<>();
                q.add(s);
                while(q.size()!=0 && dist>0 ){
                    int i=q.poll();
                    Iterator<Integer> it = a[i].listIterator();
                    int z=0;
                    while(it.hasNext() && dist>0){
                        z=it.next();
                        if(!b[z]){
                            b[z]=true;
                            dist--;
                            //dist[z] = dist[i] + 1;
                            siz++;
                            q.add(z);
                        }
                    }

                }
                return siz;
            }

            public static int lower(int key, Integer[] a){
                int l = 0;
                int r = a.length-1;
                int res = 0;

                while(l<=r){
                    int mid = (l+r)/2;

                    if(a[mid]<=key){
                        l = mid+1;
                        res = mid+1;
                    }
                    else{
                        r = mid -1;
                    }
                }

                return res;
            }

        //////////////////////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////////////////////

            public void run()
            {
                try{InputReader sc = new InputReader(new FileInputStream("input.txt"));
                    PrintWriter w = new PrintWriter(new File("output.txt"));
                // InputReader sc = new InputReader(System.in);
                // PrintWriter w = new PrintWriter(System.out);
                long defaultValue=0;

                // int tc = sc.nextInt();
                // while(tc-->0){
                    int n = sc.nextInt();
                    Integer[] a = new Integer[n];
                    for(int i=0;i<n;i++)a[i] = sc.nextInt();
                    Arrays.sort(a);
                    long min = Long.MAX_VALUE;

                    for(int i=0;i<n;i++){
                        int z = lower((a[i]*2), a);
                        long diff = (n-z+i);
                        if(z<n && a[z]<=(a[i]*2))diff--;
                        if(diff<min){
                            min = diff;
                            //w.println(i+" "+z);
                        }
                    }
                    w.println(min);

                //}
                //w.flush();
                w.close();}
                catch(Exception e){}
            }

        }


import java.awt.Point;
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args)throws Exception {
        Scanner sc=new Scanner(new File("input.txt"));
        PrintWriter p=new PrintWriter("output.txt");
        int n = sc.nextInt();
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int x = Integer.MAX_VALUE;
        int l = 0, r = arr.length - 1;
        while (l <= r) {
            int mid = l + (r - l) / 2;
            if (2 * arr[mid] < arr[n - 1]) {
                x = mid;
                l = mid + 1;
            } else r = mid - 1;
        }
        int y = Integer.MAX_VALUE;
        l = 0;
        r = arr.length - 1;
        while (l <= r) {
            int mid = l + (r - l) / 2;
            if (2 * arr[0] < arr[mid]) {
                y = mid;
                r = mid - 1;
            } else l = mid + 1;
        }
        int z = Integer.min(x + 1, n - y);
        if (z > 0 && z < n) p.println(z);
        else p.println(0);
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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;
        }
    }
}


#include <bits/stdc++.h>

using namespace std;

long long n,v,i,a,j,q,s,k,t,p[100001];

int main()
{
    cin.tie(0);
    cin >> n >> v;
    for (i=1;i<=n;i++)
    {
        cin >> a;
        for(j=1; j<=a; j++)
        {
           cin >> q;
           if(q<v and k==0)
           {
               t++;
               s++;
               p[i]=i;
           }
        }
        s=0;
    }
    cout << t << endl;
    for (i=1; i<=n; i++)
    {
        if (p[i]!=0) cout << p[i] << " ";
    }
    return 0;
}


#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    typedef long long int lli;
    lli n,v,i,j,flag=0,k,key=0;
    cin>>n>>v;
    int a[n][50],b[50];
    for(i=0;i<n;i++)
    {
        cin>>a[i][0];
        for(j=1;j<=a[i][0];j++)
        {
            cin>>a[i][j];
        }
    }
    k=0;
    for(i=0;i<n;i++)
    {
        for(j=1;j<=a[i][0];j++)
        {
            if(a[i][j]<v)
                flag=1;
        }
        if(flag==1)
        {
            b[k]=a[i][0];
            key++;
            k++;
        }
    }
    cout<<k<<"\n";
    for(i=0;i<k;i++)
        cout<<b[i]<<" ";
}


#include <iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{
    int n,v,k;
    bool a;
    cin >> n >>v;
    vector< pair<int,int> > x;
    for(int i=0;i<n;i++)
    {
        cin >> k;
        int s[k];
        for(int j=0;j<k;j++)
        {
            cin >> s[j];

        }
        for(int h=0;h<k;h++)
        {
            if(s[h]<v)
            {
                x.push_back(make_pair(s[h],i+1));
                break;
            }

        }

    }
    sort(x.begin(),x.end());
    cout << x.size()<<endl;
    for(int i=x.size()-1;i>=0;i--)
    {
        cout << x[i].second << " ";
    }
    return 0;
}


#include <iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{
    int n,v,k,s;
    bool a;
    cin >> n >>v;
    vector< pair<int,int> > x;
    for(int i=0;i<n;i++)
    {
        cin >> k;
        vector<int> y;
        for(int j=0;j<k;j++)
        {
            cin >> s;
            y.push_back(s);

        }
        sort(y.begin(),y.end());
        for(int h=0;h<k;h++)
        {
            if(y[h]<v)
            {
                x.push_back(make_pair(y[h],i+1));
                cout << y[h] << endl;
                break;
            }

        }

    }
    sort(x.begin(),x.end());
    cout << x.size()<<endl;
    for(int i=x.size()-1;i>=0;i--)
    {
        cout << x[i].second << " ";
    }
    return 0;
}


#include <iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{
    int n,v,k,p=0;
    bool x,y;
    cin >> n >> v;
    vector< pair<int,int> > q;
    for(int i=0;i<n;i++)
    {
        cin >> k;
        int s[k];
        x=false;
        for(int j=0;j<k;j++)
        {
            cin >> s[j];
            if(s[j]<v)
            {
                x=true;
                q.push_back(make_pair(s[j],i+1));
                break;
            }
        }
        if(x)
            p++;

    }
    sort(q.begin(),q.end());
    cout << p << endl;
    for(int i=q.size()-1;i>=0;i--)
    {
            cout << q[i].second << " ";
    }

    return 0;
}


#include <iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{
    int n,v,k,s,c=0;
    cin >> n >>v;
    map<int,bool> m;
    for(int j=0;j<n;j++)
        {
            m[j]=false;
        }
    for(int i=0;i<n;i++)
    {
        cin >> k;
        for(int j=0;j<k;j++)
        {
            cin >> s;
            if(s<v)
            {
                m[i]=true;
            }
        }
        if(m[i]==true)
            c++;
    }
    cout << c << endl;
    map<int,bool>::iterator it;
    it=m.begin();
    for(it;it!=m.end();it++)
    {
        if(it->second == true)
        {
            cout << it->first+1 << " ";
        }
    }
    return 0;
}


#include <iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{
    int n,v,k,s;
    bool a;
    cin >> n >>v;
    vector< pair<int,int> > x;
    for(int i=0;i<n;i++)
    {
        cin >> k;
        vector<int> y;
        for(int j=0;j<k;j++)
        {
            cin >> s;
            if(s<v)
            {
                y.push_back(s);
            }

        }
        sort(y.begin(),y.end());
        x.push_back(make_pair(y[y.size()-1],i+1));

    }
    sort(x.begin(),x.end());
    cout << x.size()<<endl;
    for(int i=x.size()-1;i>=0;i--)
    {
        cout << x[i].second << " ";
    }
    return 0;
}


#include <iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{
    int n,v,k,s;
    bool a;
    cin >> n >>v;
    vector< pair<int,int> > x;
    for(int i=0;i<n;i++)
    {
        cin >> k;
        vector<int> y;
        for(int j=0;j<k;j++)
        {
            cin >> s;
            y.push_back(s);

        }
        sort(y.begin(),y.end());
        for(int h=0;h<k;h++)
        {
            if(y[h]<v)
            {
                x.push_back(make_pair(y[h],i+1));
                break;
            }

        }

    }
    sort(x.begin(),x.end());
    cout << x.size()<<endl;
    for(int i=x.size()-1;i>=0;i--)
    {
        cout << x[i].second << " ";
    }
    return 0;
}


#include <iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;

int main()
{
    int n,v,k,s;
    bool a;
    cin >> n >>v;
    vector< pair<int,int> > x;
    for(int i=0;i<n;i++)
    {
        cin >> k;
        vector<int> y;
        for(int j=0;j<k;j++)
        {
            cin >> s;
            if(s<v)
            {
                y.push_back(s);
            }

        }
        sort(y.begin(),y.end());
        if(y.size()!=0)
        {

        x.push_back(make_pair(y[y.size()-1],i+1));
        }

    }
    sort(x.begin(),x.end());
    cout << x.size()<<endl;
    for(int i=x.size()-1;i>=0;i--)
    {
        cout << x[i].second << " ";
    }
    return 0;
}


#include<iostream>
using namespace std;
#include<queue>
int main()
{

	int n,x;
	cin >> n>>x;
	int**arr = new int*[n];
	queue<int>q;
	for (int j = 0; j < n; j++) {

		int l;
		cin >> l;
		arr[j] = new int[l];
		for (int i = 0; i < l; i++)
		{
			cin >> arr[j][i];
			if (arr[j][i] < x&& q.front() != j + 1)
			{
				q.push(j + 1);

			}

		}
	}
	cout << q.size()<<endl;
	while (!q.empty())
	{
		cout << q.front()<<" ";

		q.pop();
	}

	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
#include<queue>
int main()
{

	int n,x;
	cin >> n>>x;
	int**arr = new int*[n];
	queue<int>q;
	for (int j = 0; j < n; j++) {

			int l;
			cin >> l;
			arr[j] = new int[l];
			for (int i = 0; i < l; i++)
			{
				cin >> arr[j][i];
				if (arr[j][i] < x)
					q.push(j + 1);

		}

	}
	cout << q.size()<<endl;
	while (!q.empty())
	{
		cout << q.front()<<" ";

		q.pop();
	}

	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
#include<queue>
int main()
{

	int n,x;
	cin >> n>>x;
	int**arr = new int*[n];
	queue<int>q;
	for (int j = 0; j < n; j++) {

			int l;
			cin >> l;
			arr[j] = new int[l];
			for (int i = 0; i < l; i++)
			{
				cin >> arr[j][i];
				if (arr[j][i] < x)
					q.push(j + 1);

		}

	}
	cout << q.size();
	while (!q.empty())
	{
		cout << q.front();
		q.pop();
	}

	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
#include<queue>
int main()
{

	int n,x;
	cin >> n>>x;
	int**arr = new int*[n];
	queue<int>q;

	for (int j = 0; j < n; j++) {
		bool check = true;
		int l;
		cin >> l;
		arr[j] = new int[l];
		for (int i = 0; i < l; i++)
		{

			cin >> arr[j][i];

			if (arr[j][i] < x&&check==true)
			{
				if (q.empty())
				{
					q.push(j + 1);
					check = false;
				}
				else
				{
					if (q.front() != (j + 1))
					{
						q.push(j + 1);
						check = false;
					}
				}
			}

		}
	}
	cout << q.size()<<endl;
	while (!q.empty())
	{
		cout << q.front()<<" ";

		q.pop();
	}

	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
#include<queue>
int main()
{

	int n,x;
	cin >> n>>x;
	int**arr = new int*[n];
	queue<int>q;
	for (int j = 0; j < n; j++) {

		int l;
		cin >> l;
		arr[j] = new int[l];
		for (int i = 0; i < l; i++)
		{
			cin >> arr[j][i];

			if (arr[j][i] < x)
			{
				if(q.empty())
				q.push(j + 1);
				else
				{
					if (q.front() != (j + 1))
					{
						q.push(j + 1);

					}
				}
			}

		}
	}
	cout << q.size()<<endl;
	while (!q.empty())
	{
		cout << q.front()<<" ";

		q.pop();
	}

	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
#include<queue>
int main()
{

	int n,x;
	cin >> n>>x;
	int**arr = new int*[n];
	queue<int>q;
	for (int j = 0; j < n; j++) {

			int l;
			cin >> l;
			arr[j] = new int[l];
			for (int i = 0; i < l; i++)
			{
				cin >> arr[j][i];
				if (arr[j][i] < x)
					q.push(j + 1);

		}

	}
	cout << q.size();
	while (!q.empty())
	{
		cout << q.front()<<" ";

		q.pop();
	}

	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
#include<queue>
int main()
{

	int n,x;
	cin >> n>>x;
	int**arr = new int*[n];
	queue<int>q;
	for (int j = 0; j < n; j++) {

			int l;
			cin >> l;
			arr[j] = new int[l];
			for (int i = 0; i < l; i++)
			{
				cin >> arr[j][i];
				if (arr[j][i] < x&&q.front()!=j+1)
				{
					q.push(j + 1);

		}

	}
	cout << q.size()<<endl;
	while (!q.empty())
	{
		cout << q.front()<<" ";

		q.pop();
	}

	//system("pause");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,c=0,k=0,l,p;
    cin>>n>>m;
    vector<int>a;
    for(i=0;i<n;i++)
    {
        cin>>p;
        for(j=0;j<p;j++)
        {
            cin>>l;
            if(m>l)
            {
                c++;
                a.push_back(i+1);
                break;
            }
        }
    }
    cout<<c<<endl;
    for(int u:a)
    {
        if(u!=0)
        cout<<u<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,c=0,k=0,l,p;
    cin>>n>>m;
    vector<int>a(n);
    for(i=1;i<=n;i++)
    {
        cin>>p;
        for(j=0;j<p;j++)
        {
            cin>>l;
            if(m>l)
            {
                c++;
                a[k]=i;
                k++;
                break;
            }
        }
    }
    cout<<c<<endl;
    for(int u:a)
    {
        if(u!=0)
        cout<<u<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,c=0,k=0,l,p;
    cin>>n>>m;
    int a[50];
    for(i=0;i<n;i++)
    {
        cin>>p;
        for(j=0;j<p;j++)
        {
            cin>>l;
            if(m>l)
            {
                c++;
                a[k]=i+1;
                k++;
                break;
            }
        }
    }
    cout<<c<<endl;
    for(i=0;i<k;i++)
    {
        cout<<a[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,c=0,k=0,l,p;
    cin>>n>>m;
    vector<int>a(n);
    for(i=1;i<=n;i++)
    {
        cin>>p;
        for(j=0;j<p;j++)
        {
            cin>>l;
            if(l<m)
            {
                c++;
                a[k]=i;
                k++;
                break;
            }
        }
    }
    cout<<c<<endl;
    for(int u:a)
    {
        if(u!=0)
        cout<<u<<" ";
    }
}


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


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,p;
    cin>>n>>m;
    int b[50];
    vector<int>a;
    for(i=1;i<=n;i++)
    {
        cin>>p;
        for(j=0;j<p;j++)
            cin>>b[j];
            sort(b,b+p);
            if(b[0]<m)
            {
                a.push_back(i);
            }
    }
    cout<<a.size()<<endl;
    for(auto u:a)
    {
        cout<<u<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,c=0,k=0,g,p;
    cin>>n>>m;
    vector<int>a;
    for(i=1;i<=n;i++)
    {
        cin>>p;
        for(j=0;j<p;j++)
        {
            cin>>g;
            if(m>g)
            {
                c++;
                a.push_back(i);
                break;
            }
        }
    }
    cout<<c<<endl;
    for(auto u:a)
    {
        cout<<u<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,c=0,k=0,l,p;
    cin>>n>>m;
    vector<int>a;
    for(i=0;i<n;i++)
    {
        cin>>p;
        for(j=0;j<p;j++)
        {
            cin>>l;
            if(m>l)
            {
                cout<<i<<endl;
                c++;
                a.push_back(i+1);
                break;
            }
        }
    }
    cout<<c<<endl;
    for(int u:a)
    {
        if(u!=0)
        cout<<u<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int i,j,t,a,b,c,d,e,f,g,h,n,m,s;
    vector<int>vec;
    cin >> n >> m;
    for(i=0; i<n;i++){
        cin >> a;
        for(j=0; j<a; j++){
            cin >> b;
            if(m>b){
                vec.push_back(a);
            }
        }
    }
    c = vec.size();
    sort(vec.begin(),vec.begin()+c);
    cout<<c<<endl;
    for(i=0; i<c; i++){
        cout<<vec[i]<<" ";
    }cout<<endl;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int i,j,t,a,b,c,d,e,f,g,h,n,m,s;
    vector<int>vec;
    cin >> n >> m;
    for(i=0; i<n;i++){
        cin >> a;
        for(j=0; j<a; j++){
            cin >> b;
            if(m>b){
                vec.push_back(i+1);
            }
        }
    }
    c = vec.size();
    cout<<c<<endl;
    for(i=0; i<c; i++){
        cout<<vec[i]<<" ";
    }cout<<endl;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int i,j,t,a,b,c,d,e,f,g,h,n,m,s;
    vector<int>vec;
    cin >> n >> m;
    for(i=0; i<n;i++){
        cin >> a;
        for(j=0; j<a; j++){
            cin >> b;
            if(m>b){
                vec.push_back(a);
            }
        }
    }
    c = vec.size();
    cout<<c<<endl;
    for(i=0; i<c; i++){
        cout<<vec[i]<<" ";
    }cout<<endl;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int i,j,t,a,b,c,d,e,f,g,h,n,m,s;
    vector<int>vec;
    cin >> n >> m;
    for(i=1; i<=n;++i){
        cin >> a; bool x = 0;
        for(j=0; j<a; j++){
            cin >> b;
            if(m>b){
                x = 1;
            }
        } if(x) vec.push_back(i);
    }
    c = vec.size();
    sort(vec.begin(),vec.begin()+c);
    cout<<c<<endl;
    for(i=0; i<c; i++){
        cout<<vec[i]<<" ";
    }cout<<endl;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int i,j,t,a,b,c,d,e,f,g,h,n,m,s;
    vector<int>vec;
    cin >> n >> m;
    for(i=1; i<=n;i++){
        cin >> a;
        for(j=0; j<a; j++){
            cin >> b;
            if(m>b){
                vec.push_back(i);
                break;
            }
        }
    }
    c = vec.size();
    //sort(vec.begin(),vec.begin()+c);
    cout<<c<<endl;
    for(i=0; i<c; i++){
        cout<<vec[i]<<" ";
    }cout<<endl;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int i,j,t,a,b,c,d,e,f,g,h,n,m,s;
    vector<int>vec;
    cin >> n >> m;
    for(i=1; i<=n;i++){
        cin >> a;
        for(j=0; j<a; j++){
            cin >> b;
            if(m>b){
                vec.push_back(i);
                break;
            }
        }
    }
    c = vec.size();
    sort(vec.begin(),vec.begin()+c);
    cout<<c<<endl;
    for(i=0; i<c; i++){
        cout<<vec[i]<<" ";
    }cout<<endl;
    return 0;

}


#include<stdio.h>
int main()
{
      long long int n,m,v,k,i,j,count=0,l,t;
      scanf("%lld %lld",&n,&v);
       long long int ara[n];
      for(i=0;i<n;i++){
            scanf("%lld",&k);
            t=1;
            while(k--){
                  scanf("%lld",&m);
                  if(v>m && t){
                        ara[count]=i+1;
                        count++;
                        t=0;
                  }
            }
      }
      printf("%lld\n",count);
      for(j=0;j<count;j++){
            printf("%lld ",ara[j]);
      }
}


#include<stdio.h>
int main()
{
      long long int n,m,v,k,i,j,count=0,l;
      scanf("%lld %lld",&n,&v);
       long long int ara[n];
      for(i=0;i<n;i++){
            scanf("%lld",&k);
            while(k--){
                  scanf("%lld",&m);
                  if(v>m){
                        ara[count]=i+1;
                        count++;
                        break;
                  }
            }
      }
      printf("%lld\n",count);
      for(j=0;j<count;j++){
            printf("%lld ",ara[j]);
      }
}


#include<stdio.h>
int main()
{
      long long int n,m,v,k,i,j,count=0,l;
      scanf("%lld %lld",&n,&v);
       long long int ara[n];
      for(i=0;i<n;i++){
            scanf("%lld",&k);
            while(k--){
                  scanf("%lld",&m);
                  if(v>m){
                        ara[count]=i+1;
                        count++;
                  }
            }
      }
      printf("%lld\n",count);
      for(j=0;j<count;j++){
            printf("%lld ",ara[j]);
      }
}


#include<stdio.h>
int main()
{
      long long int n,v,k,i,j,m,count=0,l;
      scanf("%lld %lld",&n,&v);
      long long int str[n];
      for(i=0;i<n;i++){
            scanf("%lld",&k);
            for(j=0;j<k;j++){
                  scanf("%lld",&m);
                  if(v>m){
                        str[count]=i+1;
                        count++;
                        break;
                  }
            }
      }
      printf("%lld\n",count);
      for(l=0;l<count;l++){
            printf("%lld ",str[l]);
      }

      return 0;

}


#include<stdio.h>
int main()
{
      long long int n,v,k,i,j,m,count=0,l,t;
      scanf("%lld %lld",&n,&v);
      long long int str[n];
      for(i=0;i<n;i++){
                  t=1;
            scanf("%lld",&k);
            for(j=0;j<k;j++){
                  scanf("%lld",&m);
                  if(v>m && t){
                        str[count]=i+1;
                        count++;
                        t=0;
                        break;
                  }
            }
      }
      printf("%lld\n",count);
      for(l=0;l<count;l++){
            printf("%lld ",str[l]);
      }

      return 0;

}


#include<stdio.h>
int main()
{
      long long int n,v,k,i,j,m,count=0,l;
      scanf("%lld %lld",&n,&v);
      long long int str[n];
      for(i=0;i<n;i++){
            scanf("%lld",&k);
            for(j=0;j<k;j++){
                  scanf("%lld",&m);
                  if(v>m){
                        str[count]=i;
                        count++;
                        break;
                  }
            }
      }
      printf("%lld\n",count);
      for(l=0;l<count;l++){
            printf("%lld ",str[l]+1);
      }

      return 0;

}


#include<iostream>
using namespace std;
int main()
{
	int n, v, x, z, y = 0;
	bool check;
	cin >> n >> v;
	int a[50];
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		check = false;
		for (int j = 0; j <x; j++)
		{
			cin >> z;
			if (z< v)
			{

				check = true;
			}
		}
		if (check)
		{
			a[y] = i + 1;
			y++;
		}

	}

	cout << y << endl;

	for (int i = 0; i < y; i++)
		cout << a[i] << " ";
	cout << endl;

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, v, x,z, sum = 0, y = 0;
	bool check;
	cin >> n >> v;
	int a[50];
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		check = false;
		for (int j = 0; j <x; j++)
		{
			cin >> z;
			if (z< v)
			{
				sum++;

				check = true;
			}
		}
		if (check)
		{
			a[y] = x;
			y++;
		}

	}

	cout << sum << endl;
	if (sum > 0)
	{
		for (int i = 0; i < y; i++)
			cout << a[i] << " ";
		cout << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, v, x,z, y = 0;
	bool check;
	cin >> n >> v;
	int a[50];
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		check = false;
		for (int j = 0; j <x; j++)
		{
			cin >> z;
			if (z< v)
			{
				a[y] = i + 1;
				y++;
				break;
			}
		}

	}

	cout <<y << endl;

		for (int i = 0; i < y; i++)
			cout << a[i] << " ";
		cout << endl;

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, v, x,z, sum = 0, y = 0;

	cin >> n >> v;
	int a[50];
	for (int i = 0; i < n; i++)
	{
		bool check = false;
		cin >> x;

		for (int j = 0; j <x; j++)
		{
			cin >> z;
			if (z< v)
			{
				sum++;
				check = true;
				a[y] = x;
				y++;
				break;
			}
		}

	}

	cout << sum << endl;
	if (sum > 0)
	{
		for (int i = 0; i < y; i++)
			cout << a[i] << " ";
		cout << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, v, x,z, sum = 0, y = 0;

	cin >> n >> v;
	int a[50];
	for (int i = 0; i < n; i++)
	{
		bool check = false;
		cin >> x;

		for (int j = 0; j <x; j++)
		{
			cin >> z;
			if (z< v)
			{
				sum++;
				check = true;
				a[y] = x;
			}
		}

		if (check)
			y++;

	}

	cout << sum << endl;
	if (sum > 0)
	{
		for (int i = 0; i < y; i++)
			cout << a[i] << " ";
		cout << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, v, x,z, sum = 0, y = 0;
	bool check;
	cin >> n >> v;
	int a[50];
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		check = false;
		for (int j = 0; j <x; j++)
		{
			cin >> z;
			if (z< v)
			{
				sum++;

				check = true;
			}
		}
		if (check)
		{
			a[y] = i + 1;
			y++;
		}

	}

	cout <<y << endl;

		for (int i = 0; i < y; i++)
			cout << a[i] << " ";
		cout << endl;

	return 0;
}


#include <bits/stdc++>

using namespace std;

int main()
{
   int n,v,count=0,x=0;
   cin>>n>>v;
   int price[n][50]={0};
   int item[n];
   int seller[n];
   for(int i=0;i<n;i++){
    cin>>item[i];
    for(int j=0;j<item[i];j++){
        cin>>price[i][j];
    }
   }
   for(int i=0;i<n;i++){
    for(int j=0;j<item[i];i++)
        {
        if(v>price[i][j]){count++;seller[x]=i+1;x++;break;}
    }
   }
   cout<<count<<endl;
   for(int i=0;i<x;i++){
    cout<<seller[i]<<" ";
   }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   int n,v,count=0,x=0;
   cin>>n>>v;
   int price[n][50]={0};
   int item[n];
   int seller[n];
   for(int i=0;i<n;i++){
    cin>>item[i];
    for(int j=0;j<item[i];j++){
        cin>>price[i][j];
    }
   }
   for(int i=0;i<n;i++){
    for(int j=0;j<item[i];i++)
        {
        if(v>price[i][j]){count++;seller[x]=i+1;x++;break;}
    }
   }
   cout<<count<<endl;
   for(int i=0;i<x;i++){
    cout<<seller[i]<<" ";
   }
}


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

int main()
{
    int n,v,c;
    cin>>n>>v;
    int count[n];
    vector <int> v1;
    for(int i=0;i<n;i++){
        cin>>c;
        int d=0;
        for(int j=0;j<c;j++){
            int m;
            cin>>m;
            if(m<v && d==0){v1.push_back(i+1);d=1;}
        }
    }
    cout<<v1.size()<<endl;
    for(int i=0;i<v1.size();i++){
        cout<<v1[i]<<" ";
    }
}


#include <iostream>

using namespace std;

int main()
{
   int n,v,count=0,x=0;
   cin>>n>>v;
   int price[n][50]={0};
   int item[n];
   int seller[n];
   for(int i=0;i<n;i++){
    cin>>item[i];
    for(int j=0;j<item[i];j++){
        cin>>price[i][j];
    }
   }
   for(int i=0;i<n;i++){
    for(int j=0;j<item[i];i++)
        {
        if(v>price[i][j]){count++;seller[x]=i+1;x++;break;}
        else{continue;}
    }
   }
   cout<<count<<endl;
   for(int i=0;i<x;i++){
    cout<<seller[i]<<" ";
   }
}


#include <iostream>

using namespace std;

int main()
{
   int n,v,count=0,x=0;
   cin>>n>>v;
   int price[n][50]={0};
   int item[n];
   int seller[n];
   for(int i=0;i<n;i++){
    cin>>item[i];
    for(int j=0;j<item[i];j++){
        cin>>price[i][j];
    }
   }
   for(int i=0;i<n;i++){
    for(int j=0;j<item[i];j++)
        {
        if(v>price[i][j]){count++;seller[x]=i+1;x++;break;}
        else{continue;}
    }
   }
   cout<<count<<endl;
   for(int i=0;i<x;i++){
    cout<<seller[i]<<" ";
   }
}


#include <iostream>

using namespace std;

int main()
{
   int n,v,count=0,x=0;
   cin>>n>>v;
   int price[n][50]={0};
   int item[n];
   int seller[n];
   for(int i=0;i<n;i++){
    cin>>item[i];
    for(int j=0;j<item[i];j++){
        cin>>price[i][j];
    }
   }
   for(int i=0;i<n;i++){
    for(int j=0;j<item[i];i++){
        if(v>price[i][j]){count++;seller[x]=i+1;x++;break;}
    }
   }
   cout<<count<<endl;
   for(int i=0;i<x;i++){
    cout<<seller[i]<<" ";
   }
}


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

int main() {
	// your code goes here
	long long int n , v ;
	long long int q[n];
	cin >> n >> v;
	long long int a , k=0 ;
	for(int i = 0 ; i<n ; i++)
	{
	    cin >>a ;
	    int p[a];
	    for(int j = 0 ; j<a ; j++)
	    {
	        cin>>p[j];
	    }
	    sort(p , p+a);
	    if(v>p[0])
	    {
	        q[k]= i+1;

	        k++;
	    }

	}
	if(k==0)
	{
	    cout<<0;
	}
	else
	{
	    cout<<k<<"\n";
	    sort(q, q+k);
	for(int i = 0 ; i<k ; i++)
	{
	    cout<<q[i]<<" ";
	}

	}
	return 0;
}


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

int main() {
	// your code goes here
	int n , v ;
	int q[n];
	cin >> n >> v;
	int a , k=0 ;
	for(int i = 0 ; i<n ; i++)
	{
	    cin >>a ;
	    int p[a];
	    for(int j = 0 ; j<a ; j++)
	    {
	        cin>>p[j];
	    }
	    sort(p , p+a);
	    if(v>p[0])
	    {
	        q[k]= i+1;

	        k++;
	    }

	}
	if(k==0)
	{
	    cout<<0;
	}
	else
	{
	    cout<<k<<"\n";
	    sort(q, q+k);
	for(int i = 0 ; i<k ; i++)
	{
	    cout<<q[i]<<" ";
	}

	}
	return 0;
}


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

int main() {
	// your code goes here
	long int n , v ;
	long  int q[n];
	cin >> n >> v;
	long  int a , k=0 ;
	for(int i = 0 ; i<n ; i++)
	{
	    cin >>a ;
	    int p[a];
	    for(int j = 0 ; j<a ; j++)
	    {
	        cin>>p[j];
	    }
	    sort(p , p+a);
	    if(v>p[0])
	    {
	        q[k]= i+1;

	        k++;
	    }

	}
	if(k==0)
	{
	    cout<<0;
	}
	else
	{
	    cout<<k<<"\n";
	    sort(q, q+k);
	for(int i = 0 ; i<k ; i++)
	{
	    cout<<q[i]<<" ";
	}

	}
	return 0;
}


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

int main() {
	// your code goes here
	int n , v ;
	int q[n];
	cin >> n >> v;
	long  int a , k=0 ;
	for(int i = 0 ; i<n ; i++)
	{
	    cin >>a ;
	    int t=0 , s  ;
	    for(int j = 0 ; j<a ; j++)
	    {
	        cin>>s;
	        if(v>s && t==0)
	        {
	            q[k]=i+1;
	            t=1;
	            k++;
	        }

	    }

	}
	if(k==0)
	{
	    cout<<0;
	}
	else
	{
	    cout<<k<<"\n";
	    sort(q, q+k);
	for(int i = 0 ; i<k ; i++)
	{
	    cout<<q[i]<<" ";
	}

	}
	return 0;
}


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

int main() {
	// your code goes here
	int n , v ;
	int q[n];
	cin >> n >> v;
	long  int a , k=0 ;
	for(int i = 0 ; i<n ; i++)
	{
	    cin >>a ;
	    int p[a], tmp=INT_MAX;
	    for(int j = 0 ; j<a ; j++)
	    {
	        cin>>p[j];
	        {
	            if(p[j]<tmp)
	            {
	                tmp = p[j];
	            }
	        }
	    }

	    if(v>tmp )
	    {
	        q[k]= i+1;

	        k++;
	    }

	}
	if(k==0)
	{
	    cout<<0;
	}
	else
	{
	    cout<<k<<"\n";
	    sort(q, q+k);
	for(int i = 0 ; i<k ; i++)
	{
	    cout<<q[i]<<" ";
	}

	}
	return 0;
}


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

int main() {
	// your code goes here
	int n , v ;
	int q[n];
	cin >> n >> v;
	long  int a , k=0 ;
	for(int i = 0 ; i<n ; i++)
	{
	    cin >>a ;
	    int p[a], tmp=INT_MAX;
	    for(int j = 0 ; j<a ; j++)
	    {
	        cin>>p[j];
	        {
	            if(p[j]>tmp)
	            {
	                tmp = p[j];
	            }
	        }
	    }

	    if(v>tmp )
	    {
	        q[k]= i+1;

	        k++;
	    }

	}
	if(k==0)
	{
	    cout<<0;
	}
	else
	{
	    cout<<k<<"\n";
	    sort(q, q+k);
	for(int i = 0 ; i<k ; i++)
	{
	    cout<<q[i]<<" ";
	}

	}
	return 0;
}


    #include <iostream>

    using namespace std;

    int main()
    {
        int n, v;
        cin>>n>>v;
        int k,;
        int out[n];
        int l = 0;
        int count = 0;
        for(int i = 0; i < n; i++){
            cin>>k;
            int arr[k];
            for(int j = 0; j < k; j++){
                cin>>arr[j];
                if(arr[j]<v){
                    out[l] = i+1;
                    l++;
                }
            }
            if(l != 0){
                count++;
                l = 0;
            }
        }
        if(count > 0){
            cout<<count<<endl;
            for(int i = 0; i < l; i++){
                cout<<out[i]<<" ";
            }
        }
        else{
            cout<<0<<endl;
        }
        return 0;
    }


#include <iostream>

using namespace std;

int main()
{
    int n, v;
    cin>>n>>v;
    int k, s;
    int out[n];
    int l = 0;
    int count = 0;
    for(int i = 0; i < n; i++){
        cin>>k;
        int arr[k];
        for(int j = 0; j < k; k++){
            cin>>arr[j];
            if(arr[j]<v){
                out[l] = i+1;
                l++;
            }
        }
        if(l != 0){
            count++;
            l = 0;
        }
    }
    if(count > 0){
        cout<<count<<endl;
        for(int i = 0; i < l; i++){
            cout<<out[i]<<" ";
        }
    }
    else{
        cout<<0<<endl;
    }
    return 0;
}


    #include <iostream>

    using namespace std;

    int main()
    {
        int n, v;
        cin>>n>>v;
        int k;
        int out[n];
        int l = 0;
        int count = 0;
        for(int i = 0; i < n; i++){
            cin>>k;
            int arr[k];
            for(int j = 0; j < k; j++){
                cin>>arr[j];
                if(arr[j]<v){
                    out[l] = i+1;
                    l++;
                }
            }
            if(l != 0){
                count++;
                l = 0;
            }
        }
        if(count > 0){
            cout<<count<<endl;
            for(int i = 0; i < l; i++){
                cout<<out[i]<<" ";
            }
        }
        else{
            cout<<0<<endl;
        }
        return 0;
    }


    #include <iostream>

    using namespace std;

    int main()
    {
        int n, v;
        cin>>n>>v;
        int k;
        int out[n];
        int l = 0;
        int count = 0;
        for(int i = 0; i < n; i++){
            cin>>k;
            int arr[k];
            for(int j = 0; j < k; k++){
                cin>>arr[j];
                if(arr[j]<v){
                    out[l] = i+1;
                    l++;
                }
            }
            if(l != 0){
                count++;
                l = 0;
            }
        }
        if(count > 0){
            cout<<count<<endl;
            for(int i = 0; i < l; i++){
                cout<<out[i]<<" ";
            }
        }
        else{
            cout<<0<<endl;
        }
        return 0;
    }


    #include <iostream>

    using namespace std;

    int main()
    {
        int n, v;
        cin>>n>>v;
        int k;
        int out[n];
        int l = 0;
        int count = 0;
        for(int i = 0; i < n; i++){
            cin>>k;
            int arr[k];
            for(int j = 0; j < k; j++){
                cin>>arr[j];
                if(arr[j]<v){
                    out[l] = i+1;
                    l++;
                }
            }
            if(l != 0){
                count++;
            }
        }
        if(count > 0){
            cout<<count<<endl;
            for(int i = 0; i < l; i++){
                cout<<out[i]<<" ";
            }
        }
        else{
            cout<<0<<endl;
        }
        return 0;
    }


    #include <iostream>

    using namespace std;

    int main()
    {
        int n, v;
        cin>>n>>v;
        int k;
        int out[n];
        int l = 0;
        int count = 0;
        for(int i = 0; i < n; i++){
            cin>>k;
            int arr[k];
            for(int j = 0; j < k; j++){
                cin>>arr[j];
                if(arr[j]<v){
                    out[l] = i+1;
                    l++;
                    break;
                }
            }
            if(l != 0){
                count++;
            }
        }
        if(count > 0){
            cout<<count<<endl;
            for(int i = 0; i < l; i++){
                cout<<out[i]<<" ";
            }
        }
        else{
            cout<<0<<endl;
        }
        return 0;
    }


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

int main()
{
    int n, v, c, t;
    cin >> n >> v;
    vector<int> sellers;

    for (int i = 1; i <= n; i++)
    {
        bool d = false;
        cin >> c;
        for (int j = 0; j < c; j++)
        {
            cin >> t;
            if (!d and v > t)
            {
                sellers.push_back(i);
                d = true;
            }
        }
    }

    cout << sellers.size() << endl;

    for (auto& seller : sellers)
        cout << seller << " ";
    return 0;
}


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

int main() {
long int n,k;
cin>>n>>k;
vector<int>v;
for(int i=0;i<n;i++)
{
    int a;
    cin>>a;
    long int p,t=0;

    for(int j=0;j<a;j++)
    {
        cin>>p;
        if(p<k)
        {
        t++;
        }
    }
      if(t>0)
        {
        v.push_back(a);

        }

}
int p=v.size();
if(p==0)
cout<<"0";
else
{
for(int i=0;i<p;i++)
cout<<v[i]<<" ";
}

	return 0;
}


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

int main() {
long int n,k;
cin>>n>>k;
vector<int>v;
for(int i=0;i<n;i++)
{
    int a;
    cin>>a;
    long int p,t=0;

    for(int j=0;j<a;j++)
    {
        cin>>p;
        if(p<k)
        {
        t++;
        }
    }
      if(t>0)
      v.push_back(a);

}
int p=v.size();
if(p==0)
cout<<"0";
else
{
cout<<p<<endl;
sort(v.begin(),v.end());
for(int i=0;i<p;i++)
cout<<v[i]<<" ";
}

	return 0;
}


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

int main() {
long int n,k;
cin>>n>>k;
vector<int>v;
for(int i=0;i<n;i++)
{
    int a;
    cin>>a;
    long int p,t=0;

    for(int j=0;j<a;j++)
    {
        cin>>p;
        if(p<k)
        {
        t++;
        }
    }
      if(t>0)
      v.push_back(i+1);

}
int p=v.size();
if(p==0)
cout<<"0";
else
{
cout<<p<<endl;
sort(v.begin(),v.end());
for(int i=0;i<p;i++)
cout<<v[i]<<" ";
}

	return 0;
}


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

int main() {
long int n,k;
cin>>n>>k;
vector<int>v;
for(int i=0;i<n;i++)
{
    int a;
    cin>>a;
    long int p,t=0;

    for(int j=0;j<a;j++)
    {
        cin>>p;
        if(p<k)
        {
        t++;
        }
    }
      if(t==1)
      v.push_back(a);

}
int p=v.size();
if(p==0)
cout<<"0";
else
{
cout<<p<<endl;
sort(v.begin(),v.end());
for(int i=0;i<p;i++)
cout<<v[i]<<" ";
}

	return 0;
}


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

int main() {
long int n,k;
cin>>n>>k;
vector<int>v;
for(int i=0;i<n;i++)
{
    int a;
    cin>>a;
    long int p,t=0;

    for(int j=0;j<a;j++)
    {
        cin>>p;
        if(p<k)
        {
        t++;
        }
    }
      if(t>0)
        {
        v.push_back(a);

        }

}
int p=v.size();
if(p==0)
cout<<"0";
else
{
cout<<p<<endl;
for(int i=0;i<p;i++)
cout<<v[i]<<" ";
}

	return 0;
}


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

int main() {
long int n,k;
cin>>n>>k;
vector<int>v;
for(int i=0;i<n;i++)
{
    int a;
    cin>>a;
    long int p,t=0;

    for(int j=0;j<a;j++)
    {
        cin>>p;
        if(p<k)
        {
        t++;
        }
    }
      if(t==1)
      v.push_back(i+1);

}
int p=v.size();
if(p==0)
cout<<"0";
else
{
cout<<p<<endl;
sort(v.begin(),v.end());
for(int i=0;i<p;i++)
cout<<v[i]<<" ";
}

	return 0;
}


#include<iostream>
#include<string>
#include<cctype>
#include<algorithm>
using namespace std;
int main(){

	int v,k,n,s[50],a[100],c=0;
	cin>>n>>v;
	for(int i=0;i<n;i++)
	{
		cin>>k;
		for(int j=0;j<k;j++)
		{
			cin>>s[j];
		}
		for(int d=0;d<k;d++)
		{
			if(s[d]<v)
				{
					a[c++]=k;
					break;
			    }
		}
	}
	if(c==0)
		cout<<0<<endl;
	else
	{
		cout<<c-1<<endl;
	sort(a,a+n);
		for(int i=0;i<c;i++)
			cout<<a[i]<<" ";
		cout<<endl;
	}
return 0;
}


#include<iostream>
#include<string>
#include<cctype>
#include<algorthim>
#inlude<aldortim>
using namespace std;
int main(){

	int v,k,n,s[50],a[100],c=0;
	cin>>n>>v;
	for(int i=0;i<n;i++)
	{
		cin>>k;
		for(int j=0;j<k;j++)
		{
			cin>>s[j];
		}
		for(int d=0;d<k;d++)
		{
			if(s[d]<v)
				{
					a[c++]=i+1;
					break;
			    }
		}
	}
	if(c==0)
		cout<<0<<endl;
	else
	{
		cout<<c-1<<endl;
	sort(a,a+n);
		for(int i=0;i<c;i++)
			cout<<a[i]<<" ";
		cout<<endl;
	}
return 0;
}


#include<iostream>
#include<string>
#include<cctype>
#include<algorithm>
using namespace std;
int main(){

	int v,k,n,s[50],a[100],c=0;
	cin>>n>>v;
	for(int i=0;i<n;i++)
	{
		cin>>k;
		for(int j=0;j<k;j++)
		{
			cin>>s[j];
		}
		for(int d=0;d<k;d++)
		{
			if(s[d]<v)
				{
					a[c++]=k;
					break;
			    }
		}
	}
	if(c==0)
		cout<<0<<endl;
	else
	{
		cout<<c<<endl;
	sort(a,a+n);
		for(int i=0;i<c;i++)
			cout<<a[i]<<" ";
		cout<<endl;
	}
return 0;
}


#include<iostream>
#include<string>
#include<cctype>
#include<algorithm>
using namespace std;
int main(){

	int v,k,n,s[50],a[100],c=0;
	cin>>n>>v;
	for(int i=0;i<n;i++)
	{
		cin>>k;
		for(int j=0;j<k;j++)
		{
			cin>>s[j];
		}
		for(int d=0;d<k;d++)
		{
			if(s[d]<v)
				{
					a[c++]=i+1;
					break;
			    }
		}
	}
	if(c==0)
		cout<<0<<endl;
	else
	{
		cout<<c-1<<endl;
	sort(a,a+n);
		for(int i=0;i<c;i++)
			cout<<a[i]<<" ";
		cout<<endl;
	}
return 0;
}


#include<iostream>
#include<string>
#include<cctype>
#include<algorithm>
using namespace std;
int main(){

	int v,k,n,s[50],a[100],c=0;
	cin>>n>>v;
	for(int i=0;i<n;i++)
	{
		cin>>k;
		for(int j=0;j<k;j++)
		{
			cin>>s[j];
		}
		for(int d=0;d<k;d++)
		{
			if(s[d]<v)
				{
					a[c++]=i+1;
					break;
			    }
		}
	}
	if(c==0)
		cout<<0<<endl;
	else
	{
		cout<<c<<endl;
	sort(a,a+n);
		for(int i=0;i<c;i++)
			cout<<a[i]<<" ";
		cout<<endl;
	}
return 0;
}


#include<iostream>
#include<string>
#include<cctype>
#include<algorithm>
using namespace std;
int main(){

	int v,k,n,s[50],a[100],c=0;
	cin>>n>>v;
	for(int i=1;i<=n;i++)
	{
		cin>>k;
		for(int j=0;j<k;j++)
		{
			cin>>s[j];
		}
		for(int d=0;d<k;d++)
		{
			if(s[d]<v)
				{
					a[c++]=i;
					break;
			    }
		}
	}
	if(c==0)
		cout<<0<<endl;
	else
	{
		cout<<c<<endl;
	sort(a,a+c);
		for(int i=0;i<c;i++)
			cout<<a[i]<<" ";
		cout<<endl;
	}
return 0;
}