import java.util.Scanner;

public class Main {
    //B - Toll Gates
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int X = scanner.nextInt();
        int[] A = new int[100];
        for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        }
        int cost1 = 0;
        for(int i = 0; i < X; i++) {
            cost1 += A[i];
        }

        int cost2 = 0;
        for(int i = X; i < N; i++) {
            cost2 += A[i];
        }
        System.out.println(Math.min(cost1, cost2));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    //B - Toll Gates
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int X = scanner.nextInt();
        int[] A = new int[100];
        for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        }
        int cost1 = 0;
        for(int i = 0; i < X; i++) {
            cost1 += A[i];
        }

        int cost2 = 0;
        for(int i = X; i < N; i++) {
            cost2 += A[i];
        }
        System.out.println(Math.min(cost1, cost2));
    }
} Main //B - Toll Gates
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int X = scanner.nextInt();
        int[] A = new int[100];
        for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        }
        int cost1 = 0;
        for(int i = 0; i < X; i++) {
            cost1 += A[i];
        }

        int cost2 = 0;
        for(int i = X; i < N; i++) {
            cost2 += A[i];
        }
        System.out.println(Math.min(cost1, cost2));
    } main {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int X = scanner.nextInt();
        int[] A = new int[100];
        for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        }
        int cost1 = 0;
        for(int i = 0; i < X; i++) {
            cost1 += A[i];
        }

        int cost2 = 0;
        for(int i = X; i < N; i++) {
            cost2 += A[i];
        }
        System.out.println(Math.min(cost1, cost2));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int M = scanner.nextInt(); M scanner.nextInt() scanner.nextInt scanner int X = scanner.nextInt(); X scanner.nextInt() scanner.nextInt scanner int[] A = new int[100]; A new int[100] 100 for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            int m = scanner.nextInt();
            A[m] = 1;
        } {
            int m = scanner.nextInt();
            A[m] = 1;
        } int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner A[m] = 1 A[m] A m 1 int cost1 = 0; cost1 0 for(int i = 0; i < X; i++) {
            cost1 += A[i];
        } int i = 0; int i = 0; i 0 i < X i X i++ i++ i {
            cost1 += A[i];
        } {
            cost1 += A[i];
        } cost1 += A[i] cost1 A[i] A i int cost2 = 0; cost2 0 for(int i = X; i < N; i++) {
            cost2 += A[i];
        } int i = X; int i = X; i X i < N i N i++ i++ i {
            cost2 += A[i];
        } {
            cost2 += A[i];
        } cost2 += A[i] cost2 A[i] A i System.out.println(Math.min(cost1, cost2)) System.out.println System.out System System.out Math.min(cost1, cost2) Math.min Math cost1 cost2 String[] args args public class Main {
    //B - Toll Gates
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int X = scanner.nextInt();
        int[] A = new int[100];
        for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        }
        int cost1 = 0;
        for(int i = 0; i < X; i++) {
            cost1 += A[i];
        }

        int cost2 = 0;
        for(int i = X; i < N; i++) {
            cost2 += A[i];
        }
        System.out.println(Math.min(cost1, cost2));
    }
} public class Main {
    //B - Toll Gates
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int X = scanner.nextInt();
        int[] A = new int[100];
        for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        }
        int cost1 = 0;
        for(int i = 0; i < X; i++) {
            cost1 += A[i];
        }

        int cost2 = 0;
        for(int i = X; i < N; i++) {
            cost2 += A[i];
        }
        System.out.println(Math.min(cost1, cost2));
    }
} Main
import java.util.Scanner;

public class Main {
    //B - Toll Gates
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int X = scanner.nextInt();
        int[] A = new int[100];
        for(int i = 0; i < M; i++) {
            int m = scanner.nextInt();
            A[m] = 1;
        }
        int cost1 = 0;
        for(int i = 0; i < X; i++) {
            cost1 += A[i];
        }

        int cost2 = 0;
        for(int i = X; i < N; i++) {
            cost2 += A[i];
        }
        System.out.println(Math.min(cost1, cost2));
    }
}
