import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        HashSet<Integer> station = new HashSet<>();
        for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        }
        int costR = 0;
        for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        }
        int costL = 0;
        for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        }
        System.out.println(Math.min(costR, costL));
    }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        HashSet<Integer> station = new HashSet<>();
        for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        }
        int costR = 0;
        for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        }
        int costL = 0;
        for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        }
        System.out.println(Math.min(costR, costL));
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        HashSet<Integer> station = new HashSet<>();
        for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        }
        int costR = 0;
        for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        }
        int costL = 0;
        for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        }
        System.out.println(Math.min(costR, costL));
    } main {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        HashSet<Integer> station = new HashSet<>();
        for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        }
        int costR = 0;
        for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        }
        int costL = 0;
        for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        }
        System.out.println(Math.min(costR, costL));
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int M = scan.nextInt(); M scan.nextInt() scan.nextInt scan int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan HashSet<Integer> station = new HashSet<>(); station new HashSet<>() for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            station.add(scan.nextInt());
        } {
            station.add(scan.nextInt());
        } station.add(scan.nextInt()) station.add station scan.nextInt() scan.nextInt scan int costR = 0; costR 0 for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        } int i = 0; int i = 0; i 0 i < X i X i++ i++ i {
            if (station.contains(i)) {
                costR += 1;
            }
        } {
            if (station.contains(i)) {
                costR += 1;
            }
        } if (station.contains(i)) {
                costR += 1;
            } station.contains(i) station.contains station i {
                costR += 1;
            } costR += 1 costR 1 int costL = 0; costL 0 for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        } int i = X+1; int i = X+1; i X+1 X 1 i <= N i N i++ i++ i {
            if (station.contains(i)) {
                costL += 1;
            }
        } {
            if (station.contains(i)) {
                costL += 1;
            }
        } if (station.contains(i)) {
                costL += 1;
            } station.contains(i) station.contains station i {
                costL += 1;
            } costL += 1 costL 1 System.out.println(Math.min(costR, costL)) System.out.println System.out System System.out Math.min(costR, costL) Math.min Math costR costL String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        HashSet<Integer> station = new HashSet<>();
        for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        }
        int costR = 0;
        for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        }
        int costL = 0;
        for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        }
        System.out.println(Math.min(costR, costL));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        HashSet<Integer> station = new HashSet<>();
        for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        }
        int costR = 0;
        for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        }
        int costL = 0;
        for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        }
        System.out.println(Math.min(costR, costL));
    }
} Main
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int X = scan.nextInt();
        HashSet<Integer> station = new HashSet<>();
        for (int i = 0; i < M; i++) {
            station.add(scan.nextInt());
        }
        int costR = 0;
        for(int i = 0; i < X; i++) {
            if (station.contains(i)) {
                costR += 1;
            }
        }
        int costL = 0;
        for(int i = X+1; i <= N; i++) {
            if (station.contains(i)) {
                costL += 1;
            }
        }
        System.out.println(Math.min(costR, costL));
    }
}
