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];
		for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		}
		int left = 0;
		int right = 0;
		for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		}
		System.out.println(Math.min(right, left));
	}
} 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];
		for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		}
		int left = 0;
		int right = 0;
		for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		}
		System.out.println(Math.min(right, left));
	}
} 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];
		for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		}
		int left = 0;
		int right = 0;
		for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		}
		System.out.println(Math.min(right, left));
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		}
		int left = 0;
		int right = 0;
		for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		}
		System.out.println(Math.min(right, left));
	} 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 for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int left = 0; left 0 int right = 0; right 0 for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			if (A[i] < X) left++;
			else right++;
		} {
			if (A[i] < X) left++;
			else right++;
		} if (A[i] < X) left++;
			else right++; A[i] < X A[i] A i X left++ left right++ right System.out.println(Math.min(right, left)) System.out.println System.out System System.out Math.min(right, left) Math.min Math right left 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];
		for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		}
		int left = 0;
		int right = 0;
		for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		}
		System.out.println(Math.min(right, left));
	}
} 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];
		for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		}
		int left = 0;
		int right = 0;
		for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		}
		System.out.println(Math.min(right, left));
	}
} Main
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];
		for (int i=0; i<M; i++) {
			A[i] = sc.nextInt();
		}
		int left = 0;
		int right = 0;
		for (int i=0; i<M; i++) {
			if (A[i] < X) left++;
			else right++;
		}
		System.out.println(Math.min(right, left));
	}
}
