import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        }
    }
} import java.util.*; util.* java public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        }
    }
} Main static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        }
    } main {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        }
    } int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        } {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        } if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            } scanner.nextInt() > x scanner.nextInt() scanner.nextInt scanner x {
                System.out.println(Math.min(i, m - i));
                return;
            } System.out.println(Math.min(i, m - i)) System.out.println System.out System System.out Math.min(i, m - i) Math.min Math i m - i m i return; String[]$ $ public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        }
    }
} public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        }
    }
} Main
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        for (int i = 0; i < m; i++) {
            if (scanner.nextInt() > x) {
                System.out.println(Math.min(i, m - i));
                return;
            }
        }
    }
}