import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] cost = new int[n+1];
		for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		}

		for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		}
		System.out.println(calcCost(x,cost));

	}

	private static int calcCost(int x, int[] costtable) {
		int left=0;
		for(int i=0;i<x;i++) {
			left+=costtable[i];
		}
		int right=0;
		for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		}
		return left<right?left:right;
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] cost = new int[n+1];
		for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		}

		for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		}
		System.out.println(calcCost(x,cost));

	}

	private static int calcCost(int x, int[] costtable) {
		int left=0;
		for(int i=0;i<x;i++) {
			left+=costtable[i];
		}
		int right=0;
		for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		}
		return left<right?left:right;
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] cost = new int[n+1];
		for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		}

		for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		}
		System.out.println(calcCost(x,cost));

	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] cost = new int[n+1];
		for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		}

		for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		}
		System.out.println(calcCost(x,cost));

	} 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[] cost = new int[n+1]; cost new int[n+1] n+1 n 1 for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		} int i=0; int i=0; i 0 i<cost.length i cost.length cost cost.length i++ i++ i {
			cost[i] = 0;
		} {
			cost[i] = 0;
		} cost[i] = 0 cost[i] cost i 0 for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		} int i=0; int i=0; i 0 i<m i m i++ i++ i {
			int am = sc.nextInt();
			cost[am] = 1;
		} {
			int am = sc.nextInt();
			cost[am] = 1;
		} int am = sc.nextInt(); am sc.nextInt() sc.nextInt sc cost[am] = 1 cost[am] cost am 1 System.out.println(calcCost(x,cost)) System.out.println System.out System System.out calcCost(x,cost) calcCost x cost String[] args args private static int calcCost(int x, int[] costtable) {
		int left=0;
		for(int i=0;i<x;i++) {
			left+=costtable[i];
		}
		int right=0;
		for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		}
		return left<right?left:right;
	} calcCost {
		int left=0;
		for(int i=0;i<x;i++) {
			left+=costtable[i];
		}
		int right=0;
		for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		}
		return left<right?left:right;
	} int left=0; left 0 for(int i=0;i<x;i++) {
			left+=costtable[i];
		} int i=0; int i=0; i 0 i<x i x i++ i++ i {
			left+=costtable[i];
		} {
			left+=costtable[i];
		} left+=costtable[i] left costtable[i] costtable i int right=0; right 0 for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		} int i=x; int i=x; i x i<costtable.length i costtable.length costtable costtable.length i++ i++ i {
			right+=costtable[i];
		} {
			right+=costtable[i];
		} right+=costtable[i] right costtable[i] costtable i return left<right?left:right; left<right?left:right left<right left right left right int x x int[] costtable costtable public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] cost = new int[n+1];
		for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		}

		for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		}
		System.out.println(calcCost(x,cost));

	}

	private static int calcCost(int x, int[] costtable) {
		int left=0;
		for(int i=0;i<x;i++) {
			left+=costtable[i];
		}
		int right=0;
		for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		}
		return left<right?left:right;
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] cost = new int[n+1];
		for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		}

		for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		}
		System.out.println(calcCost(x,cost));

	}

	private static int calcCost(int x, int[] costtable) {
		int left=0;
		for(int i=0;i<x;i++) {
			left+=costtable[i];
		}
		int right=0;
		for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		}
		return left<right?left:right;
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int[] cost = new int[n+1];
		for(int i=0;i<cost.length;i++) {
			cost[i] = 0;
		}

		for (int i=0;i<m;i++) {
			int am = sc.nextInt();
			cost[am] = 1;
		}
		System.out.println(calcCost(x,cost));

	}

	private static int calcCost(int x, int[] costtable) {
		int left=0;
		for(int i=0;i<x;i++) {
			left+=costtable[i];
		}
		int right=0;
		for(int i=x;i<costtable.length;i++) {
			right+=costtable[i];
		}
		return left<right?left:right;
	}

}