import java.util.Scanner;

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[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        }
        System.out.println(Math.min(sum1, sum2));
    }
} 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[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        }
        System.out.println(Math.min(sum1, sum2));
    }
} 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[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        }
        System.out.println(Math.min(sum1, sum2));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        }
        System.out.println(Math.min(sum1, sum2));
    } 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]; a new int[m] m for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int sum1 = 0; sum1 0 int sum2 = 0; sum2 0 for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        } {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        } if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++; x > a[i] x a[i] a i sum1++ sum1 if(x < a[i]) sum2++; x < a[i] x a[i] a i sum2++ sum2 System.out.println(Math.min(sum1, sum2)) System.out.println System.out System System.out Math.min(sum1, sum2) Math.min Math sum1 sum2 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[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        }
        System.out.println(Math.min(sum1, sum2));
    }
} 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[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        }
        System.out.println(Math.min(sum1, sum2));
    }
} Main
import java.util.Scanner;

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[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < m; i++) {
            if(x > a[i]) sum1++;
            else if(x < a[i]) sum2++;
        }
        System.out.println(Math.min(sum1, sum2));
    }
}