import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] array = new int[n + 1];
        for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        }
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        }
        int a = 0;
        int b = 0;
        for (int i = 0; i < x; i++) {
            a += array[i];
        }
        for (int i = x; i < n; i++) {
            b += array[i];
        }
        
        System.out.println(Math.min(a, b));
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] array = new int[n + 1];
        for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        }
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        }
        int a = 0;
        int b = 0;
        for (int i = 0; i < x; i++) {
            a += array[i];
        }
        for (int i = x; i < n; i++) {
            b += array[i];
        }
        
        System.out.println(Math.min(a, b));
        
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] array = new int[n + 1];
        for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        }
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        }
        int a = 0;
        int b = 0;
        for (int i = 0; i < x; i++) {
            a += array[i];
        }
        for (int i = x; i < n; i++) {
            b += array[i];
        }
        
        System.out.println(Math.min(a, b));
        
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] array = new int[n + 1];
        for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        }
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        }
        int a = 0;
        int b = 0;
        for (int i = 0; i < x; i++) {
            a += array[i];
        }
        for (int i = x; i < n; i++) {
            b += array[i];
        }
        
        System.out.println(Math.min(a, b));
        
    } 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[] array = new int[n + 1]; array new int[n + 1] n + 1 n 1 for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        } int i = 0; int i = 0; i 0 i < n + 1 i n + 1 n 1 i++ i++ i {
            array[i] = 0;
        } {
            array[i] = 0;
        } array[i] = 0 array[i] array i 0 for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            int p = sc.nextInt();
            array[p] = 1;
        } {
            int p = sc.nextInt();
            array[p] = 1;
        } int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc array[p] = 1 array[p] array p 1 int a = 0; a 0 int b = 0; b 0 for (int i = 0; i < x; i++) {
            a += array[i];
        } int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
            a += array[i];
        } {
            a += array[i];
        } a += array[i] a array[i] array i for (int i = x; i < n; i++) {
            b += array[i];
        } int i = x; int i = x; i x i < n i n i++ i++ i {
            b += array[i];
        } {
            b += array[i];
        } b += array[i] b array[i] array i System.out.println(Math.min(a, b)) System.out.println System.out System System.out Math.min(a, b) Math.min Math a b String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] array = new int[n + 1];
        for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        }
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        }
        int a = 0;
        int b = 0;
        for (int i = 0; i < x; i++) {
            a += array[i];
        }
        for (int i = x; i < n; i++) {
            b += array[i];
        }
        
        System.out.println(Math.min(a, b));
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] array = new int[n + 1];
        for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        }
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        }
        int a = 0;
        int b = 0;
        for (int i = 0; i < x; i++) {
            a += array[i];
        }
        for (int i = x; i < n; i++) {
            b += array[i];
        }
        
        System.out.println(Math.min(a, b));
        
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] array = new int[n + 1];
        for (int i = 0; i < n + 1; i++) {
            array[i] = 0;
        }
        for (int i = 0; i < m; i++) {
            int p = sc.nextInt();
            array[p] = 1;
        }
        int a = 0;
        int b = 0;
        for (int i = 0; i < x; i++) {
            a += array[i];
        }
        for (int i = x; i < n; i++) {
            b += array[i];
        }
        
        System.out.println(Math.min(a, b));
        
    }
}
