import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		@SuppressWarnings("unused")
		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 c1 = 0;
		int c2 = 0;
		for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		}

		pr.println(Math.min(c1, c2));
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		@SuppressWarnings("unused")
		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 c1 = 0;
		int c2 = 0;
		for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		}

		pr.println(Math.min(c1, c2));
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr static String INPUT = null; INPUT null private static void solve() {
		@SuppressWarnings("unused")
		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 c1 = 0;
		int c2 = 0;
		for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		}

		pr.println(Math.min(c1, c2));
	} solve {
		@SuppressWarnings("unused")
		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 c1 = 0;
		int c2 = 0;
		for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		}

		pr.println(Math.min(c1, c2));
	} @SuppressWarnings("unused")
		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 c1 = 0; c1 0 int c2 = 0; c2 0 for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		} int e a {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		} {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		} if (e < x) {
				c1++;
			} else {
				c2++;
			} e < x e x {
				c1++;
			} c1++ c1 {
				c2++;
			} c2++ c2 pr.println(Math.min(c1, c2)) pr.println pr Math.min(c1, c2) Math.min Math c1 c2 // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	} main {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	} sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())) sc new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.flush() pr.flush pr String[] args args private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	} Printer Printer(OutputStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out OutputStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		@SuppressWarnings("unused")
		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 c1 = 0;
		int c2 = 0;
		for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		}

		pr.println(Math.min(c1, c2));
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		@SuppressWarnings("unused")
		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 c1 = 0;
		int c2 = 0;
		for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		}

		pr.println(Math.min(c1, c2));
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		@SuppressWarnings("unused")
		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 c1 = 0;
		int c2 = 0;
		for (int e : a) {
			if (e < x) {
				c1++;
			} else {
				c2++;
			}
		}

		pr.println(Math.min(c1, c2));
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
