import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), m = in.nextInt(), x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        }
        int ans1 = 0,ans2 = 0;
        for (int i = x; i > 0; i--) {
            ans1 += a[i];
        }
        for (int i = x; i < n; i++) {
            ans2 += a[i];
        }
        System.out.println(Math.min(ans1, ans2));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), m = in.nextInt(), x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        }
        int ans1 = 0,ans2 = 0;
        for (int i = x; i > 0; i--) {
            ans1 += a[i];
        }
        for (int i = x; i < n; i++) {
            ans2 += a[i];
        }
        System.out.println(Math.min(ans1, ans2));
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), m = in.nextInt(), x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        }
        int ans1 = 0,ans2 = 0;
        for (int i = x; i > 0; i--) {
            ans1 += a[i];
        }
        for (int i = x; i < n; i++) {
            ans2 += a[i];
        }
        System.out.println(Math.min(ans1, ans2));
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), m = in.nextInt(), x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        }
        int ans1 = 0,ans2 = 0;
        for (int i = x; i > 0; i--) {
            ans1 += a[i];
        }
        for (int i = x; i < n; i++) {
            ans2 += a[i];
        }
        System.out.println(Math.min(ans1, ans2));
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt() n in.nextInt() in.nextInt in m = in.nextInt() m in.nextInt() in.nextInt in x = in.nextInt(); x in.nextInt() in.nextInt in int[] a = new int[n]; a new int[n] n for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[in.nextInt()] = 1;
        } {
            a[in.nextInt()] = 1;
        } a[in.nextInt()] = 1 a[in.nextInt()] a in.nextInt() in.nextInt in 1 int ans1 = 0 ans1 0 ans2 = 0; ans2 0 for (int i = x; i > 0; i--) {
            ans1 += a[i];
        } int i = x; int i = x; i x i > 0 i 0 i-- i-- i {
            ans1 += a[i];
        } {
            ans1 += a[i];
        } ans1 += a[i] ans1 a[i] a i for (int i = x; i < n; i++) {
            ans2 += a[i];
        } int i = x; int i = x; i x i < n i n i++ i++ i {
            ans2 += a[i];
        } {
            ans2 += a[i];
        } ans2 += a[i] ans2 a[i] a i System.out.println(Math.min(ans1, ans2)) System.out.println System.out System System.out Math.min(ans1, ans2) Math.min Math ans1 ans2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), m = in.nextInt(), x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        }
        int ans1 = 0,ans2 = 0;
        for (int i = x; i > 0; i--) {
            ans1 += a[i];
        }
        for (int i = x; i < n; i++) {
            ans2 += a[i];
        }
        System.out.println(Math.min(ans1, ans2));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), m = in.nextInt(), x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        }
        int ans1 = 0,ans2 = 0;
        for (int i = x; i > 0; i--) {
            ans1 += a[i];
        }
        for (int i = x; i < n; i++) {
            ans2 += a[i];
        }
        System.out.println(Math.min(ans1, ans2));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), m = in.nextInt(), x = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < m; i++) {
            a[in.nextInt()] = 1;
        }
        int ans1 = 0,ans2 = 0;
        for (int i = x; i > 0; i--) {
            ans1 += a[i];
        }
        for (int i = x; i < n; i++) {
            ans2 += a[i];
        }
        System.out.println(Math.min(ans1, ans2));
    }
}
