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 = sc.nextInt();
        int left = 0;
        while (a < X) {
            a = sc.nextInt();
            left++;
        }
        System.out.println(Math.min(left, M - left));
        
    }

} 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 = sc.nextInt();
        int left = 0;
        while (a < X) {
            a = sc.nextInt();
            left++;
        }
        System.out.println(Math.min(left, M - 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 a = sc.nextInt();
        int left = 0;
        while (a < X) {
            a = sc.nextInt();
            left++;
        }
        System.out.println(Math.min(left, M - left));
        
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int a = sc.nextInt();
        int left = 0;
        while (a < X) {
            a = sc.nextInt();
            left++;
        }
        System.out.println(Math.min(left, M - 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 a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int left = 0; left 0 while (a < X) {
            a = sc.nextInt();
            left++;
        } a < X a X {
            a = sc.nextInt();
            left++;
        } a = sc.nextInt() a sc.nextInt() sc.nextInt sc left++ left System.out.println(Math.min(left, M - left)) System.out.println System.out System System.out Math.min(left, M - left) Math.min Math left M - left M 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 a = sc.nextInt();
        int left = 0;
        while (a < X) {
            a = sc.nextInt();
            left++;
        }
        System.out.println(Math.min(left, M - 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 a = sc.nextInt();
        int left = 0;
        while (a < X) {
            a = sc.nextInt();
            left++;
        }
        System.out.println(Math.min(left, M - left));
        
    }

} 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 = sc.nextInt();
        int left = 0;
        while (a < X) {
            a = sc.nextInt();
            left++;
        }
        System.out.println(Math.min(left, M - left));
        
    }

}
