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

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

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

		int rcost = 0;
		for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		}

		int lcost = 0;
		for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		}

		if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		}

	}

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

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

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

		int rcost = 0;
		for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		}

		int lcost = 0;
		for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		}

		if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		}

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

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

		int rcost = 0;
		for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		}

		int lcost = 0;
		for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		}

		if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		}

	} main {
		Scanner sc = new Scanner(System.in);

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

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

		int rcost = 0;
		for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		}

		int lcost = 0;
		for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		}

		if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc final int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc final int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc List<Integer> mlist = new ArrayList<Integer>(); mlist new ArrayList<Integer>() for (int i = 0; i < m; i++) {
			mlist.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			mlist.add(sc.nextInt());
		} {
			mlist.add(sc.nextInt());
		} mlist.add(sc.nextInt()) mlist.add mlist sc.nextInt() sc.nextInt sc int rcost = 0; rcost 0 for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		} int j = x; int j = x; j x j < n j n j++ j++ j {
			if (mlist.contains(j)) {
				rcost++;
			}
		} {
			if (mlist.contains(j)) {
				rcost++;
			}
		} if (mlist.contains(j)) {
				rcost++;
			} mlist.contains(j) mlist.contains mlist j {
				rcost++;
			} rcost++ rcost int lcost = 0; lcost 0 for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		} int k = x; int k = x; k x k > 0 k 0 k-- k-- k {
			if (mlist.contains(k)) {
				lcost++;
			}
		} {
			if (mlist.contains(k)) {
				lcost++;
			}
		} if (mlist.contains(k)) {
				lcost++;
			} mlist.contains(k) mlist.contains mlist k {
				lcost++;
			} lcost++ lcost if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		} rcost > lcost rcost lcost {
			System.out.println(lcost);
		} System.out.println(lcost) System.out.println System.out System System.out lcost {
			System.out.println(rcost);
		} System.out.println(rcost) System.out.println System.out System System.out rcost String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

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

		int rcost = 0;
		for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		}

		int lcost = 0;
		for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		}

		if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

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

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

		int rcost = 0;
		for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		}

		int lcost = 0;
		for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		}

		if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		}

	}

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

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

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

		int rcost = 0;
		for (int j = x; j < n; j++) {
			if (mlist.contains(j)) {
				rcost++;
			}
		}

		int lcost = 0;
		for (int k = x; k > 0; k--) {
			if (mlist.contains(k)) {
				lcost++;
			}
		}

		if (rcost > lcost) {
			System.out.println(lcost);
		} else {
			System.out.println(rcost);
		}

	}

}
