import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //マスの数
		int m = stdIn.nextInt(); //料金所の数
		int x = stdIn.nextInt(); //今いる場所
		int[] a = new int[m];
		
		for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		}
		
		int cntleft = 0;
		int cntright = 0;
		
		for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		}
			
		int min = Math.min(cntleft, cntright);
		System.out.println(min);
	}	

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //マスの数
		int m = stdIn.nextInt(); //料金所の数
		int x = stdIn.nextInt(); //今いる場所
		int[] a = new int[m];
		
		for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		}
		
		int cntleft = 0;
		int cntright = 0;
		
		for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		}
			
		int min = Math.min(cntleft, cntright);
		System.out.println(min);
	}	

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //マスの数
		int m = stdIn.nextInt(); //料金所の数
		int x = stdIn.nextInt(); //今いる場所
		int[] a = new int[m];
		
		for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		}
		
		int cntleft = 0;
		int cntright = 0;
		
		for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		}
			
		int min = Math.min(cntleft, cntright);
		System.out.println(min);
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //マスの数
		int m = stdIn.nextInt(); //料金所の数
		int x = stdIn.nextInt(); //今いる場所
		int[] a = new int[m];
		
		for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		}
		
		int cntleft = 0;
		int cntright = 0;
		
		for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		}
			
		int min = Math.min(cntleft, cntright);
		System.out.println(min);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int m = stdIn.nextInt(); m stdIn.nextInt() stdIn.nextInt stdIn int x = stdIn.nextInt(); x stdIn.nextInt() stdIn.nextInt stdIn int[] a = new int[m]; a new int[m] m for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			a[i] = stdIn.nextInt();
		} {
			a[i] = stdIn.nextInt();
		} a[i] = stdIn.nextInt() a[i] a i stdIn.nextInt() stdIn.nextInt stdIn int cntleft = 0; cntleft 0 int cntright = 0; cntright 0 for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		} {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		} if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			} a[i] < x a[i] a i x {
				cntleft++;
			} cntleft++ cntleft {
				cntright++;
			} cntright++ cntright int min = Math.min(cntleft, cntright); min Math.min(cntleft, cntright) Math.min Math cntleft cntright System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //マスの数
		int m = stdIn.nextInt(); //料金所の数
		int x = stdIn.nextInt(); //今いる場所
		int[] a = new int[m];
		
		for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		}
		
		int cntleft = 0;
		int cntright = 0;
		
		for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		}
			
		int min = Math.min(cntleft, cntright);
		System.out.println(min);
	}	

} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //マスの数
		int m = stdIn.nextInt(); //料金所の数
		int x = stdIn.nextInt(); //今いる場所
		int[] a = new int[m];
		
		for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		}
		
		int cntleft = 0;
		int cntright = 0;
		
		for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		}
			
		int min = Math.min(cntleft, cntright);
		System.out.println(min);
	}	

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //マスの数
		int m = stdIn.nextInt(); //料金所の数
		int x = stdIn.nextInt(); //今いる場所
		int[] a = new int[m];
		
		for(int i = 0; i < m; i++) {
			a[i] = stdIn.nextInt();
		}
		
		int cntleft = 0;
		int cntright = 0;
		
		for(int i = 0; i < m; i++) {
			if(a[i] < x) {
				cntleft++;
			}else {
				cntright++;
			}
		}
			
		int min = Math.min(cntleft, cntright);
		System.out.println(min);
	}	

}
