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[] points = new int[m];

        int left = 0;
        int right = 0;

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

        int left = 0;
        int right = 0;

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

        int left = 0;
        int right = 0;

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

        int left = 0;
        int right = 0;

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

        int left = 0;
        int right = 0;

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

        int left = 0;
        int right = 0;

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

        int left = 0;
        int right = 0;

        for (int point : points) {
            point = sc.nextInt();
            if (point < x) {
                left++;
            } else {
                right++;
            }
        }
        System.out.println(Math.min(left, right));
    }
}
