import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int x=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		}
		int before=0;
		int after=0;
		
		for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		}
		System.out.println(Math.min(before,after));
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int x=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		}
		int before=0;
		int after=0;
		
		for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		}
		System.out.println(Math.min(before,after));
	}
} Main public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int x=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		}
		int before=0;
		int after=0;
		
		for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		}
		System.out.println(Math.min(before,after));
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int x=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		}
		int before=0;
		int after=0;
		
		for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		}
		System.out.println(Math.min(before,after));
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int m=sc.nextInt(); m sc.nextInt() sc.nextInt sc int x=sc.nextInt(); x sc.nextInt() sc.nextInt sc ArrayList<Integer> a=new ArrayList<Integer>(); a new ArrayList<Integer>() for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		} int i=1; int i=1; i 1 i<=m i m i++ i++ i {
			a.add(sc.nextInt());
		} {
			a.add(sc.nextInt());
		} a.add(sc.nextInt()) a.add a sc.nextInt() sc.nextInt sc int before=0; before 0 int after=0; after 0 for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		} int i=0; int i=0; i 0 i<m i m i++ i++ i {
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		} {
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		} if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			} a.get(i)<x a.get(i) a.get a i x {
				before+=1;
			} before+=1 before 1 {
				after+=1;
			} after+=1 after 1 System.out.println(Math.min(before,after)) System.out.println System.out System System.out Math.min(before,after) Math.min Math before after String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int x=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		}
		int before=0;
		int after=0;
		
		for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		}
		System.out.println(Math.min(before,after));
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int x=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		}
		int before=0;
		int after=0;
		
		for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		}
		System.out.println(Math.min(before,after));
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		int x=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for (int i=1;i<=m;i++){
			a.add(sc.nextInt());
		}
		int before=0;
		int after=0;
		
		for (int i=0;i<m;i++){
			if (a.get(i)<x){
				before+=1;
			}else{
				after+=1;
			}
		}
		System.out.println(Math.min(before,after));
	}
}