import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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();

		List<Integer> cost = new ArrayList<Integer>();
		for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		}

		int temp = 0;
		for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		}

		int op = 0;
		for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		}
		System.out.println(Math.min(op, temp));
	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util 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();
		int m = sc.nextInt();
		int x = sc.nextInt();

		List<Integer> cost = new ArrayList<Integer>();
		for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		}

		int temp = 0;
		for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		}

		int op = 0;
		for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		}
		System.out.println(Math.min(op, temp));
	}

} 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();

		List<Integer> cost = new ArrayList<Integer>();
		for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		}

		int temp = 0;
		for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		}

		int op = 0;
		for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		}
		System.out.println(Math.min(op, temp));
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		List<Integer> cost = new ArrayList<Integer>();
		for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		}

		int temp = 0;
		for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		}

		int op = 0;
		for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		}
		System.out.println(Math.min(op, temp));
	} 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 List<Integer> cost = new ArrayList<Integer>(); cost new ArrayList<Integer>() for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			cost.add(sc.nextInt());
		} {
			cost.add(sc.nextInt());
		} cost.add(sc.nextInt()) cost.add cost sc.nextInt() sc.nextInt sc int temp = 0; temp 0 for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		} int i = 0; int i = 0; i 0 i <= x i x i++ i++ i {
			if (cost.contains(i)) {
				temp++;
			}
		} {
			if (cost.contains(i)) {
				temp++;
			}
		} if (cost.contains(i)) {
				temp++;
			} cost.contains(i) cost.contains cost i {
				temp++;
			} temp++ temp int op = 0; op 0 for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		} int i = x; int i = x; i x i <= n i n i++ i++ i {
			if (cost.contains(i)) {
				op++;
			}
		} {
			if (cost.contains(i)) {
				op++;
			}
		} if (cost.contains(i)) {
				op++;
			} cost.contains(i) cost.contains cost i {
				op++;
			} op++ op System.out.println(Math.min(op, temp)) System.out.println System.out System System.out Math.min(op, temp) Math.min Math op temp 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();

		List<Integer> cost = new ArrayList<Integer>();
		for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		}

		int temp = 0;
		for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		}

		int op = 0;
		for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		}
		System.out.println(Math.min(op, temp));
	}

} 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();

		List<Integer> cost = new ArrayList<Integer>();
		for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		}

		int temp = 0;
		for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		}

		int op = 0;
		for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		}
		System.out.println(Math.min(op, temp));
	}

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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();

		List<Integer> cost = new ArrayList<Integer>();
		for (int i = 0; i < m; i++) {
			cost.add(sc.nextInt());
		}

		int temp = 0;
		for (int i = 0; i <= x; i++) {
			if (cost.contains(i)) {
				temp++;
			}
		}

		int op = 0;
		for (int i = x; i <= n; i++) {
			if (cost.contains(i)) {
				op++;
			}
		}
		System.out.println(Math.min(op, temp));
	}

}