import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        }
    } try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        } {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            } sc.hasNext() sc.hasNext sc {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            } String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line.split(" ")[0]); n Integer.parseInt(line.split(" ")[0]) Integer.parseInt Integer line.split(" ")[0] line.split(" ") line.split line " " 0 int m = Integer.parseInt(line.split(" ")[1]); m Integer.parseInt(line.split(" ")[1]) Integer.parseInt Integer line.split(" ")[1] line.split(" ") line.split line " " 1 int x = Integer.parseInt(line.split(" ")[2]); x Integer.parseInt(line.split(" ")[2]) Integer.parseInt Integer line.split(" ")[2] line.split(" ") line.split line " " 2 String[] a_strs = sc.nextLine().split(" "); a_strs sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int l = a_strs.length; l a_strs.length a_strs a_strs.length int counter = 0; counter 0 for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                } int i=0; int i=0; i 0 i<l i l i++ i++ i {
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                } {
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                } if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    } Integer.parseInt(a_strs[i]) < x Integer.parseInt(a_strs[i]) Integer.parseInt Integer a_strs[i] a_strs i x {
                        counter++;
                    } counter++ counter {
                        break;
                    } break; System.out.println((counter < l-counter) ? counter : l - counter) System.out.println System.out System System.out (counter < l-counter) ? counter : l - counter (counter < l-counter) counter l-counter l counter counter l - counter l counter String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNext()) {
                String line = sc.nextLine();
                int n = Integer.parseInt(line.split(" ")[0]);
                int m = Integer.parseInt(line.split(" ")[1]);
                int x = Integer.parseInt(line.split(" ")[2]);
                String[] a_strs = sc.nextLine().split(" ");
                int l = a_strs.length;
                int counter = 0;
                for(int i=0; i<l; i++){
                    if(Integer.parseInt(a_strs[i]) < x){
                        counter++;
                    }else{
                        break;
                    }
                }
                System.out.println((counter < l-counter) ? counter : l - counter);
            }
        }
    }
}