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

        for (int i = 0; i < m; i++) {
            nums[i] = sc.nextInt();
        }
        sc.close();

        int num = 0;

        for (int i = 0; i < m; i++) {
            if (nums[i] >= x) {
                num++;
            }
        }
        int ans = Math.min(m - num, num);
        System.out.println(ans);
    }
} 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[] nums = new int[m];

        for (int i = 0; i < m; i++) {
            nums[i] = sc.nextInt();
        }
        sc.close();

        int num = 0;

        for (int i = 0; i < m; i++) {
            if (nums[i] >= x) {
                num++;
            }
        }
        int ans = Math.min(m - num, num);
        System.out.println(ans);
    }
} 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[] nums = new int[m];

        for (int i = 0; i < m; i++) {
            nums[i] = sc.nextInt();
        }
        sc.close();

        int num = 0;

        for (int i = 0; i < m; i++) {
            if (nums[i] >= x) {
                num++;
            }
        }
        int ans = Math.min(m - num, num);
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] nums = new int[m];

        for (int i = 0; i < m; i++) {
            nums[i] = sc.nextInt();
        }
        sc.close();

        int num = 0;

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

        for (int i = 0; i < m; i++) {
            nums[i] = sc.nextInt();
        }
        sc.close();

        int num = 0;

        for (int i = 0; i < m; i++) {
            if (nums[i] >= x) {
                num++;
            }
        }
        int ans = Math.min(m - num, num);
        System.out.println(ans);
    }
} 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[] nums = new int[m];

        for (int i = 0; i < m; i++) {
            nums[i] = sc.nextInt();
        }
        sc.close();

        int num = 0;

        for (int i = 0; i < m; i++) {
            if (nums[i] >= x) {
                num++;
            }
        }
        int ans = Math.min(m - num, num);
        System.out.println(ans);
    }
} 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[] nums = new int[m];

        for (int i = 0; i < m; i++) {
            nums[i] = sc.nextInt();
        }
        sc.close();

        int num = 0;

        for (int i = 0; i < m; i++) {
            if (nums[i] >= x) {
                num++;
            }
        }
        int ans = Math.min(m - num, num);
        System.out.println(ans);
    }
}