import 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[n + 1];
		int pn = 0;
		int p0 = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		}
		if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		}
	}
} import java.util.*; util.* java 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[n + 1];
		int pn = 0;
		int p0 = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		}
		if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		}
	}
} 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[n + 1];
		int pn = 0;
		int p0 = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		}
		if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		// スペース区切りの整数の入力
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] a = new int[n + 1];
		int pn = 0;
		int p0 = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		}
		if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		}
	} 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[n + 1]; a new int[n + 1] n + 1 n 1 int pn = 0; pn 0 int p0 = 0; p0 0 for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		} {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			} x > a[i] x a[i] a i {
				p0++;
			} p0++ p0 if (x < a[i]) {
				pn++;
			} x < a[i] x a[i] a i {
				pn++;
			} pn++ pn if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		} pn >= p0 pn p0 {
			System.out.println(p0);

		} System.out.println(p0) System.out.println System.out System System.out p0 {
			System.out.println(pn);
		} System.out.println(pn) System.out.println System.out System System.out pn 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[n + 1];
		int pn = 0;
		int p0 = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		}
		if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		}
	}
} 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[n + 1];
		int pn = 0;
		int p0 = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		}
		if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		}
	}
} Main
import 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[n + 1];
		int pn = 0;
		int p0 = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (x > a[i]) {
				p0++;
			} else if (x < a[i]) {
				pn++;
			}
		}
		if (pn >= p0) {
			System.out.println(p0);

		} else {
			System.out.println(pn);
		}
	}
}
