import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();
		int m = sc1.nextInt();
		int x = sc1.nextInt();
		int[] a = new int[m];
		int cost1 = 0;
		int cost2 = 0;

		for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		}

		if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		}

		sc1.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();
		int m = sc1.nextInt();
		int x = sc1.nextInt();
		int[] a = new int[m];
		int cost1 = 0;
		int cost2 = 0;

		for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		}

		if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		}

		sc1.close();
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();
		int m = sc1.nextInt();
		int x = sc1.nextInt();
		int[] a = new int[m];
		int cost1 = 0;
		int cost2 = 0;

		for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		}

		if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		}

		sc1.close();
	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();
		int m = sc1.nextInt();
		int x = sc1.nextInt();
		int[] a = new int[m];
		int cost1 = 0;
		int cost2 = 0;

		for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		}

		if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		}

		sc1.close();
	} Scanner sc1 = new Scanner(System.in); sc1 new Scanner(System.in) int n = sc1.nextInt(); n sc1.nextInt() sc1.nextInt sc1 int m = sc1.nextInt(); m sc1.nextInt() sc1.nextInt sc1 int x = sc1.nextInt(); x sc1.nextInt() sc1.nextInt sc1 int[] a = new int[m]; a new int[m] m int cost1 = 0; cost1 0 int cost2 = 0; cost2 0 for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		} int i = 0 ; int i = 0 ; i 0 i < m i m i++ i++ i {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		} {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		} a[i] = sc1.nextInt() a[i] a i sc1.nextInt() sc1.nextInt sc1 if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			} a[i] < x a[i] a i x {
				cost1++;
			} cost1++ cost1 if (a[i] > x) {
				cost2++;
			} a[i] > x a[i] a i x {
				cost2++;
			} cost2++ cost2 if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		} cost1 < cost2 cost1 cost2 {
			System.out.println(cost1);
		} System.out.println(cost1) System.out.println System.out System System.out cost1 {
			System.out.println(cost2);
		} System.out.println(cost2) System.out.println System.out System System.out cost2 sc1.close() sc1.close sc1 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();
		int m = sc1.nextInt();
		int x = sc1.nextInt();
		int[] a = new int[m];
		int cost1 = 0;
		int cost2 = 0;

		for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		}

		if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		}

		sc1.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();
		int m = sc1.nextInt();
		int x = sc1.nextInt();
		int[] a = new int[m];
		int cost1 = 0;
		int cost2 = 0;

		for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		}

		if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		}

		sc1.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int n = sc1.nextInt();
		int m = sc1.nextInt();
		int x = sc1.nextInt();
		int[] a = new int[m];
		int cost1 = 0;
		int cost2 = 0;

		for (int i = 0 ; i < m ; i++ ) {
			a[i] = sc1.nextInt();
			if (a[i] < x) {
				cost1++;
			}
			else if (a[i] > x) {
				cost2++;
			}
		}

		if (cost1 < cost2) {
			System.out.println(cost1);
		}
		else {
			System.out.println(cost2);
		}

		sc1.close();
	}

}
