import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int m = scan.nextInt();
	    int x = scan.nextInt();
	    int a[]=new int[m];
	    for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    int check=0;
	    int cnt[]= {0,0};
		for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		}
	    System.out.println(Math.min(cnt[0], cnt[1]));
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int m = scan.nextInt();
	    int x = scan.nextInt();
	    int a[]=new int[m];
	    for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    int check=0;
	    int cnt[]= {0,0};
		for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		}
	    System.out.println(Math.min(cnt[0], cnt[1]));
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int m = scan.nextInt();
	    int x = scan.nextInt();
	    int a[]=new int[m];
	    for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    int check=0;
	    int cnt[]= {0,0};
		for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		}
	    System.out.println(Math.min(cnt[0], cnt[1]));
	} main {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int m = scan.nextInt();
	    int x = scan.nextInt();
	    int a[]=new int[m];
	    for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    int check=0;
	    int cnt[]= {0,0};
		for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		}
	    System.out.println(Math.min(cnt[0], cnt[1]));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int a[]=new int[m]; a new int[m] m for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    } int i=0; int i=0; i 0 i<m i m i++ i++ i {
	    	a[i]=scan.nextInt();
	    } {
	    	a[i]=scan.nextInt();
	    } a[i]=scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan scan.close() scan.close scan int check=0; check 0 int cnt[]= {0,0}; cnt {0,0} 0 0 for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		} int j=0; int j=0; j 0 j<m j m j++ j++ j {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		} {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		} if(a[j]>x)check=1; a[j]>x a[j] a j x check=1 check 1 cnt[check]+=1 cnt[check] cnt check 1 System.out.println(Math.min(cnt[0], cnt[1])) System.out.println System.out System System.out Math.min(cnt[0], cnt[1]) Math.min Math cnt[0] cnt 0 cnt[1] cnt 1 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int m = scan.nextInt();
	    int x = scan.nextInt();
	    int a[]=new int[m];
	    for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    int check=0;
	    int cnt[]= {0,0};
		for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		}
	    System.out.println(Math.min(cnt[0], cnt[1]));
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int m = scan.nextInt();
	    int x = scan.nextInt();
	    int a[]=new int[m];
	    for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    int check=0;
	    int cnt[]= {0,0};
		for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		}
	    System.out.println(Math.min(cnt[0], cnt[1]));
	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int m = scan.nextInt();
	    int x = scan.nextInt();
	    int a[]=new int[m];
	    for(int i=0;i<m;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    int check=0;
	    int cnt[]= {0,0};
		for(int j=0;j<m;j++) {
			if(a[j]>x)check=1;
			cnt[check]+=1;
		}
	    System.out.println(Math.min(cnt[0], cnt[1]));
	}

}