//2019/04/07
import java.util.Scanner;
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();

		int[] A = new int[M];

		int r = 0;

		int l = 0;

		for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		}

		int ans = Math.min(r, l);

		System.out.println(ans);
	}

} import java.util.Scanner; Scanner 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();

		int[] A = new int[M];

		int r = 0;

		int l = 0;

		for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		}

		int ans = Math.min(r, l);

		System.out.println(ans);
	}

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

		int[] A = new int[M];

		int r = 0;

		int l = 0;

		for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		}

		int ans = Math.min(r, l);

		System.out.println(ans);
	} main {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		int M = sc.nextInt();

		int X = sc.nextInt();

		int[] A = new int[M];

		int r = 0;

		int l = 0;

		for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		}

		int ans = Math.min(r, l);

		System.out.println(ans);
	} 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 int[] A = new int[M]; A new int[M] M int r = 0; r 0 int l = 0; l 0 for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		} {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc if(A[i]<X) l++;

			else r++; A[i]<X A[i] A i X l++ l r++ r int ans = Math.min(r, l); ans Math.min(r, l) Math.min Math r l System.out.println(ans) System.out.println System.out System System.out ans 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();

		int[] A = new int[M];

		int r = 0;

		int l = 0;

		for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		}

		int ans = Math.min(r, l);

		System.out.println(ans);
	}

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

		int[] A = new int[M];

		int r = 0;

		int l = 0;

		for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		}

		int ans = Math.min(r, l);

		System.out.println(ans);
	}

} Main
//2019/04/07
import java.util.Scanner;
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();

		int[] A = new int[M];

		int r = 0;

		int l = 0;

		for(int i=0;i<M;i++) {

			A[i] = sc.nextInt();

			if(A[i]<X) l++;

			else r++;
		}

		int ans = Math.min(r, l);

		System.out.println(ans);
	}

}
