import 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 left = 0;
        int right = 0;
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }

        for (int i = 0; i < m; i++) {
            if (x < a[i])
                right++;
            else
                left++;
        }
        System.out.println(Math.min(right, left));
    }
} import java.util.*; util.* java 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 left = 0;
        int right = 0;
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }

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

        for (int i = 0; i < m; i++) {
            if (x < a[i])
                right++;
            else
                left++;
        }
        System.out.println(Math.min(right, left));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        int[] a = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }

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

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

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

        for (int i = 0; i < m; i++) {
            if (x < a[i])
                right++;
            else
                left++;
        }
        System.out.println(Math.min(right, left));
    }
}