import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int A[] = new int[M];

		int sum1 = 0, sum2 = 0;
		for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		}
		sc.close();
		System.out.println(Math.min(sum1, sum2));
	}
} 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(), M = sc.nextInt(), X = sc.nextInt();
		int A[] = new int[M];

		int sum1 = 0, sum2 = 0;
		for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		}
		sc.close();
		System.out.println(Math.min(sum1, sum2));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int A[] = new int[M];

		int sum1 = 0, sum2 = 0;
		for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		}
		sc.close();
		System.out.println(Math.min(sum1, sum2));
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int A[] = new int[M];

		int sum1 = 0, sum2 = 0;
		for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		}
		sc.close();
		System.out.println(Math.min(sum1, sum2));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc M = sc.nextInt() M sc.nextInt() sc.nextInt sc X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int A[] = new int[M]; A new int[M] M int sum1 = 0 sum1 0 sum2 = 0; sum2 0 for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		} {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			} A[i] > X A[i] A i X {
				sum1++;
			} sum1++ sum1 if (A[i] < X) {
				sum2++;
			} A[i] < X A[i] A i X {
				sum2++;
			} sum2++ sum2 sc.close() sc.close sc System.out.println(Math.min(sum1, sum2)) System.out.println System.out System System.out Math.min(sum1, sum2) Math.min Math sum1 sum2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int A[] = new int[M];

		int sum1 = 0, sum2 = 0;
		for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		}
		sc.close();
		System.out.println(Math.min(sum1, sum2));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int A[] = new int[M];

		int sum1 = 0, sum2 = 0;
		for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		}
		sc.close();
		System.out.println(Math.min(sum1, sum2));
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int A[] = new int[M];

		int sum1 = 0, sum2 = 0;
		for (int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
			if (A[i] > X) {
				sum1++;
			} else if (A[i] < X) {
				sum2++;
			}
		}
		sc.close();
		System.out.println(Math.min(sum1, sum2));
	}
}
