import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		int N=sc.nextInt();
		int M=sc.nextInt();
		int X=sc.nextInt();
		int a=0,b=0;
		int tmp;
		for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		}
		p(Math.min(a, b));
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
}
	 import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		int N=sc.nextInt();
		int M=sc.nextInt();
		int X=sc.nextInt();
		int a=0,b=0;
		int tmp;
		for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		}
		p(Math.min(a, b));
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
} Main static int a1[]= {0,-1,0,1}; a1 {0,-1,0,1} 0 -1 1 0 1 static int b1[]= {-1,0,1,0}; b1 {-1,0,1,0} -1 1 0 1 0 private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) //Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		int N=sc.nextInt();
		int M=sc.nextInt();
		int X=sc.nextInt();
		int a=0,b=0;
		int tmp;
		for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		}
		p(Math.min(a, b));
	} main {
		int N=sc.nextInt();
		int M=sc.nextInt();
		int X=sc.nextInt();
		int a=0,b=0;
		int tmp;
		for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		}
		p(Math.min(a, b));
	} 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 int a=0 a 0 b=0; b 0 int tmp; tmp for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		} {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		} tmp=sc.nextInt() tmp sc.nextInt() sc.nextInt sc if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			} tmp<X tmp X {
				a++;
			} a++ a if(tmp>X) {
				b++;
			} tmp>X tmp X {
				b++;
			} b++ b p(Math.min(a, b)) p Math.min(a, b) Math.min Math a b String[] args args static void p(String ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans String ans ans static void p(int ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans int ans ans static void p() {System.out.println();} p {System.out.println();} System.out.println() System.out.println System.out System System.out static void p(long ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans long ans ans static void p(double ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans double ans ans public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		int N=sc.nextInt();
		int M=sc.nextInt();
		int X=sc.nextInt();
		int a=0,b=0;
		int tmp;
		for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		}
		p(Math.min(a, b));
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
} public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		int N=sc.nextInt();
		int M=sc.nextInt();
		int X=sc.nextInt();
		int a=0,b=0;
		int tmp;
		for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		}
		p(Math.min(a, b));
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");
	public static void main(String[] args) {
		int N=sc.nextInt();
		int M=sc.nextInt();
		int X=sc.nextInt();
		int a=0,b=0;
		int tmp;
		for(int i=0;i<M;i++) {
			tmp=sc.nextInt();
			if(tmp<X) {
				a++;
			}else if(tmp>X) {
				b++;
			}
		}
		p(Math.min(a, b));
	}
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
}
	