import java.util.Scanner;

// 19
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();
        int[] a = new int[n + 1];
        for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1;

        int left = 0;
        int right = 0;
        for(int i = 0; i < x; i++)
            left += a[i];
        for(int i = x; i < n + 1; i++)
            right += a[i];

        System.out.println(Math.min(left, right));
    }

} 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();
        int[] a = new int[n + 1];
        for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1;

        int left = 0;
        int right = 0;
        for(int i = 0; i < x; i++)
            left += a[i];
        for(int i = x; i < n + 1; i++)
            right += a[i];

        System.out.println(Math.min(left, right));
    }

} 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();
        int[] a = new int[n + 1];
        for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1;

        int left = 0;
        int right = 0;
        for(int i = 0; i < x; i++)
            left += a[i];
        for(int i = x; i < n + 1; i++)
            right += a[i];

        System.out.println(Math.min(left, right));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] a = new int[n + 1];
        for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1;

        int left = 0;
        int right = 0;
        for(int i = 0; i < x; i++)
            left += a[i];
        for(int i = x; i < n + 1; i++)
            right += a[i];

        System.out.println(Math.min(left, right));
    } 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[] a = new int[n + 1]; a new int[n + 1] n + 1 n 1 for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1; int i = 0; int i = 0; i 0 i < m i m i++ i++ i a[sc.nextInt()] = 1; a[sc.nextInt()] = 1 a[sc.nextInt()] a sc.nextInt() sc.nextInt sc 1 int left = 0; left 0 int right = 0; right 0 for(int i = 0; i < x; i++)
            left += a[i]; int i = 0; int i = 0; i 0 i < x i x i++ i++ i left += a[i]; left += a[i] left a[i] a i for(int i = x; i < n + 1; i++)
            right += a[i]; int i = x; int i = x; i x i < n + 1 i n + 1 n 1 i++ i++ i right += a[i]; right += a[i] right a[i] a i System.out.println(Math.min(left, right)) System.out.println System.out System System.out Math.min(left, right) Math.min Math left right 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();
        int[] a = new int[n + 1];
        for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1;

        int left = 0;
        int right = 0;
        for(int i = 0; i < x; i++)
            left += a[i];
        for(int i = x; i < n + 1; i++)
            right += a[i];

        System.out.println(Math.min(left, right));
    }

} 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();
        int[] a = new int[n + 1];
        for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1;

        int left = 0;
        int right = 0;
        for(int i = 0; i < x; i++)
            left += a[i];
        for(int i = x; i < n + 1; i++)
            right += a[i];

        System.out.println(Math.min(left, right));
    }

} Main
import java.util.Scanner;

// 19
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();
        int[] a = new int[n + 1];
        for(int i = 0; i < m; i++)
            a[sc.nextInt()] = 1;

        int left = 0;
        int right = 0;
        for(int i = 0; i < x; i++)
            left += a[i];
        for(int i = x; i < n + 1; i++)
            right += a[i];

        System.out.println(Math.min(left, right));
    }

}
