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<Boolean> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(false);
        }
        for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        }

        int costZero = 0;
        int costN = 0;
        for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        }
        for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        }
        System.out.println(Math.min(costZero, costN));
    }

} 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<Boolean> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(false);
        }
        for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        }

        int costZero = 0;
        int costN = 0;
        for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        }
        for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        }
        System.out.println(Math.min(costZero, costN));
    }

} 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<Boolean> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(false);
        }
        for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        }

        int costZero = 0;
        int costN = 0;
        for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        }
        for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        }
        System.out.println(Math.min(costZero, costN));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        List<Boolean> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(false);
        }
        for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        }

        int costZero = 0;
        int costN = 0;
        for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        }
        for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        }
        System.out.println(Math.min(costZero, costN));
    } 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<Boolean> a = new ArrayList<>(); a new ArrayList<>() for (int i = 0; i < n; i++) {
            a.add(false);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a.add(false);
        } {
            a.add(false);
        } a.add(false) a.add a false for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a.set(sc.nextInt(), true);
        } {
            a.set(sc.nextInt(), true);
        } a.set(sc.nextInt(), true) a.set a sc.nextInt() sc.nextInt sc true int costZero = 0; costZero 0 int costN = 0; costN 0 for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        } int i = x; int i = x; i x i > 0 i 0 i-- i-- i {
            if (a.get(i)) {
                costZero++;
            }
        } {
            if (a.get(i)) {
                costZero++;
            }
        } if (a.get(i)) {
                costZero++;
            } a.get(i) a.get a i {
                costZero++;
            } costZero++ costZero for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        } int i = x; int i = x; i x i < n i n i++ i++ i {
            if (a.get(i)) {
                costN++;
            }
        } {
            if (a.get(i)) {
                costN++;
            }
        } if (a.get(i)) {
                costN++;
            } a.get(i) a.get a i {
                costN++;
            } costN++ costN System.out.println(Math.min(costZero, costN)) System.out.println System.out System System.out Math.min(costZero, costN) Math.min Math costZero costN 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<Boolean> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(false);
        }
        for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        }

        int costZero = 0;
        int costN = 0;
        for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        }
        for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        }
        System.out.println(Math.min(costZero, costN));
    }

} 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<Boolean> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(false);
        }
        for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        }

        int costZero = 0;
        int costN = 0;
        for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        }
        for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        }
        System.out.println(Math.min(costZero, costN));
    }

} 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<Boolean> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(false);
        }
        for (int i = 0; i < m; i++) {
            a.set(sc.nextInt(), true);
        }

        int costZero = 0;
        int costN = 0;
        for (int i = x; i > 0; i--) {
            if (a.get(i)) {
                costZero++;
            }
        }
        for (int i = x; i < n; i++) {
            if (a.get(i)) {
                costN++;
            }
        }
        System.out.println(Math.min(costZero, costN));
    }

}
