import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();

        int[] A = new int[M + 1];
        int[] costs = new int[]{0,0};
        for (int i = 1; i <= M; i++) {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        }

        System.out.println(Math.min(costs[0], costs[1]));

        return;
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();

        int[] A = new int[M + 1];
        int[] costs = new int[]{0,0};
        for (int i = 1; i <= M; i++) {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        }

        System.out.println(Math.min(costs[0], costs[1]));

        return;
    }

} Solver public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();

        int[] A = new int[M + 1];
        int[] costs = new int[]{0,0};
        for (int i = 1; i <= M; i++) {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        }

        System.out.println(Math.min(costs[0], costs[1]));

        return;
    } run {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();

        int[] A = new int[M + 1];
        int[] costs = new int[]{0,0};
        for (int i = 1; i <= M; i++) {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        }

        System.out.println(Math.min(costs[0], costs[1]));

        return;
    } 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[M + 1]; A new int[M + 1] M + 1 M 1 int[] costs = new int[]{0,0}; costs new int[]{0,0} for (int i = 1; i <= M; i++) {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        } int i = 1; int i = 1; i 1 i <= M i M i++ i++ i {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        } {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        } A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            } A[i] < X A[i] A i X {
                costs[0] += 1;
            } costs[0] += 1 costs[0] costs 0 1 if (A[i] > X) {
                costs[1] += 1;
            } A[i] > X A[i] A i X {
                costs[1] += 1;
            } costs[1] += 1 costs[1] costs 1 1 System.out.println(Math.min(costs[0], costs[1])) System.out.println System.out System System.out Math.min(costs[0], costs[1]) Math.min Math costs[0] costs 0 costs[1] costs 1 return;
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();

        int[] A = new int[M + 1];
        int[] costs = new int[]{0,0};
        for (int i = 1; i <= M; i++) {
            A[i] = sc.nextInt();
            if (A[i] < X) {
                costs[0] += 1;
            } else if (A[i] > X) {
                costs[1] += 1;
            }
        }

        System.out.println(Math.min(costs[0], costs[1]));

        return;
    }

}