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 costLeft = 0;
		int costRight = 0;
		while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		}
		
		System.out.println(Integer.min(costLeft, costRight));
	}
} 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 costLeft = 0;
		int costRight = 0;
		while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		}
		
		System.out.println(Integer.min(costLeft, costRight));
	}
} 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 costLeft = 0;
		int costRight = 0;
		while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		}
		
		System.out.println(Integer.min(costLeft, costRight));
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int costLeft = 0;
		int costRight = 0;
		while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		}
		
		System.out.println(Integer.min(costLeft, costRight));
	} 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 costLeft = 0; costLeft 0 int costRight = 0; costRight 0 while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		} sc.hasNextInt() sc.hasNextInt sc {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		} int i = sc.nextInt(); i sc.nextInt() sc.nextInt sc if (i > X) {
				costRight++;
			} i > X i X {
				costRight++;
			} costRight++ costRight if (i < X) {
				costLeft++;
			} i < X i X {
				costLeft++;
			} costLeft++ costLeft System.out.println(Integer.min(costLeft, costRight)) System.out.println System.out System System.out Integer.min(costLeft, costRight) Integer.min Integer costLeft costRight 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 costLeft = 0;
		int costRight = 0;
		while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		}
		
		System.out.println(Integer.min(costLeft, costRight));
	}
} 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 costLeft = 0;
		int costRight = 0;
		while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		}
		
		System.out.println(Integer.min(costLeft, costRight));
	}
} 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 costLeft = 0;
		int costRight = 0;
		while (sc.hasNextInt()) {
			int i = sc.nextInt();
			if (i > X) {
				costRight++;
			}
			if (i < X) {
				costLeft++;
			}
		}
		
		System.out.println(Integer.min(costLeft, costRight));
	}
}