import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
    public static void main(String[] args) throws IOException {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        }
    }
}

class InputReader implements Closeable, AutoCloseable {
    private final BufferedReader br;

    InputReader(InputStream inputStream) {
        this.br = new BufferedReader(new InputStreamReader(inputStream));
    }

    String readLine() throws IOException {
        return this.br.readLine();
    }

    int readInt() throws IOException {
        return Integer.parseInt(this.br.readLine());
    }

    long readLong() throws IOException {
        return Long.parseLong(this.br.readLine());
    }

    String[] readStringsSplitByDelimiter(String delimiter) throws IOException {
        return this.br.readLine().split(delimiter);
    }

    int[] readIntsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        int[] ints = new int[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            ints[i] = Integer.parseInt(strings[i]);
        }

        return ints;
    }

    long[] readLongsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        long[] longs = new long[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            longs[i] = Long.parseLong(strings[i]);
        }

        return longs;
    }

    @Override
    public void close() throws IOException {
        br.close();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.Closeable; Closeable java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
    public static void main(String[] args) throws IOException {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        }
    }
} Main public static void main(String[] args) throws IOException {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        }
    } main {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        }
    } try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        } {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        } PrintWriter writer = new PrintWriter(System.out) PrintWriter writer = new PrintWriter(System.out) new PrintWriter(System.out) InputReader reader = new InputReader(System.in) InputReader reader = new InputReader(System.in) new InputReader(System.in) int[] nmx = reader.readIntsSplitByDelimiter(" "); nmx reader.readIntsSplitByDelimiter(" ") reader.readIntsSplitByDelimiter reader " " int[] costIndexs = reader.readIntsSplitByDelimiter(" "); costIndexs reader.readIntsSplitByDelimiter(" ") reader.readIntsSplitByDelimiter reader " " int costToRight = 0; costToRight 0 int costToLeft = 0; costToLeft 0 for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            } int costIndex costIndexs {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            } {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            } if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                } costIndex < nmx[2] costIndex nmx[2] nmx 2 {
                    costToRight++;
                } costToRight++ costToRight {
                    costToLeft++;
                } costToLeft++ costToLeft if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            } costToRight < costToLeft costToRight costToLeft {
                System.out.println(costToRight);
            } System.out.println(costToRight) System.out.println System.out System System.out costToRight {
                System.out.println(costToLeft);
            } System.out.println(costToLeft) System.out.println System.out System System.out costToLeft String[] args args class InputReader implements Closeable, AutoCloseable {
    private final BufferedReader br;

    InputReader(InputStream inputStream) {
        this.br = new BufferedReader(new InputStreamReader(inputStream));
    }

    String readLine() throws IOException {
        return this.br.readLine();
    }

    int readInt() throws IOException {
        return Integer.parseInt(this.br.readLine());
    }

    long readLong() throws IOException {
        return Long.parseLong(this.br.readLine());
    }

    String[] readStringsSplitByDelimiter(String delimiter) throws IOException {
        return this.br.readLine().split(delimiter);
    }

    int[] readIntsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        int[] ints = new int[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            ints[i] = Integer.parseInt(strings[i]);
        }

        return ints;
    }

    long[] readLongsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        long[] longs = new long[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            longs[i] = Long.parseLong(strings[i]);
        }

        return longs;
    }

    @Override
    public void close() throws IOException {
        br.close();
    }
} InputReader private final BufferedReader br; br InputReader(InputStream inputStream) {
        this.br = new BufferedReader(new InputStreamReader(inputStream));
    } InputReader {
        this.br = new BufferedReader(new InputStreamReader(inputStream));
    } this.br = new BufferedReader(new InputStreamReader(inputStream)) this.br this this.br new BufferedReader(new InputStreamReader(inputStream)) InputStream inputStream inputStream String readLine() throws IOException {
        return this.br.readLine();
    } readLine {
        return this.br.readLine();
    } return this.br.readLine(); this.br.readLine() this.br.readLine this.br this this.br int readInt() throws IOException {
        return Integer.parseInt(this.br.readLine());
    } readInt {
        return Integer.parseInt(this.br.readLine());
    } return Integer.parseInt(this.br.readLine()); Integer.parseInt(this.br.readLine()) Integer.parseInt Integer this.br.readLine() this.br.readLine this.br this this.br long readLong() throws IOException {
        return Long.parseLong(this.br.readLine());
    } readLong {
        return Long.parseLong(this.br.readLine());
    } return Long.parseLong(this.br.readLine()); Long.parseLong(this.br.readLine()) Long.parseLong Long this.br.readLine() this.br.readLine this.br this this.br String[] readStringsSplitByDelimiter(String delimiter) throws IOException {
        return this.br.readLine().split(delimiter);
    } readStringsSplitByDelimiter {
        return this.br.readLine().split(delimiter);
    } return this.br.readLine().split(delimiter); this.br.readLine().split(delimiter) this.br.readLine().split this.br.readLine() this.br.readLine this.br this this.br delimiter String delimiter delimiter int[] readIntsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        int[] ints = new int[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            ints[i] = Integer.parseInt(strings[i]);
        }

        return ints;
    } readIntsSplitByDelimiter {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        int[] ints = new int[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            ints[i] = Integer.parseInt(strings[i]);
        }

        return ints;
    } String[] strings = this.br.readLine().split(delimiter); strings this.br.readLine().split(delimiter) this.br.readLine().split this.br.readLine() this.br.readLine this.br this this.br delimiter int stringsLength = strings.length; stringsLength strings.length strings strings.length int[] ints = new int[stringsLength]; ints new int[stringsLength] stringsLength for (int i = 0; i < stringsLength; i++) {
            ints[i] = Integer.parseInt(strings[i]);
        } int i = 0; int i = 0; i 0 i < stringsLength i stringsLength i++ i++ i {
            ints[i] = Integer.parseInt(strings[i]);
        } {
            ints[i] = Integer.parseInt(strings[i]);
        } ints[i] = Integer.parseInt(strings[i]) ints[i] ints i Integer.parseInt(strings[i]) Integer.parseInt Integer strings[i] strings i return ints; ints String delimiter delimiter long[] readLongsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        long[] longs = new long[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            longs[i] = Long.parseLong(strings[i]);
        }

        return longs;
    } readLongsSplitByDelimiter {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        long[] longs = new long[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            longs[i] = Long.parseLong(strings[i]);
        }

        return longs;
    } String[] strings = this.br.readLine().split(delimiter); strings this.br.readLine().split(delimiter) this.br.readLine().split this.br.readLine() this.br.readLine this.br this this.br delimiter int stringsLength = strings.length; stringsLength strings.length strings strings.length long[] longs = new long[stringsLength]; longs new long[stringsLength] stringsLength for (int i = 0; i < stringsLength; i++) {
            longs[i] = Long.parseLong(strings[i]);
        } int i = 0; int i = 0; i 0 i < stringsLength i stringsLength i++ i++ i {
            longs[i] = Long.parseLong(strings[i]);
        } {
            longs[i] = Long.parseLong(strings[i]);
        } longs[i] = Long.parseLong(strings[i]) longs[i] longs i Long.parseLong(strings[i]) Long.parseLong Long strings[i] strings i return longs; longs String delimiter delimiter @Override
    public void close() throws IOException {
        br.close();
    } close {
        br.close();
    } br.close() br.close br Closeable AutoCloseable public class Main {
    public static void main(String[] args) throws IOException {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
    public static void main(String[] args) throws IOException {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            int[] nmx = reader.readIntsSplitByDelimiter(" ");
            int[] costIndexs = reader.readIntsSplitByDelimiter(" ");

            int costToRight = 0;
            int costToLeft = 0;
            for (int costIndex : costIndexs) {
                if (costIndex < nmx[2]) {
                    costToRight++;
                } else {
                    costToLeft++;
                }
            }

            if (costToRight < costToLeft) {
                System.out.println(costToRight);
            } else {
                System.out.println(costToLeft);
            }
        }
    }
}

class InputReader implements Closeable, AutoCloseable {
    private final BufferedReader br;

    InputReader(InputStream inputStream) {
        this.br = new BufferedReader(new InputStreamReader(inputStream));
    }

    String readLine() throws IOException {
        return this.br.readLine();
    }

    int readInt() throws IOException {
        return Integer.parseInt(this.br.readLine());
    }

    long readLong() throws IOException {
        return Long.parseLong(this.br.readLine());
    }

    String[] readStringsSplitByDelimiter(String delimiter) throws IOException {
        return this.br.readLine().split(delimiter);
    }

    int[] readIntsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        int[] ints = new int[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            ints[i] = Integer.parseInt(strings[i]);
        }

        return ints;
    }

    long[] readLongsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.br.readLine().split(delimiter);

        int stringsLength = strings.length;
        long[] longs = new long[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            longs[i] = Long.parseLong(strings[i]);
        }

        return longs;
    }

    @Override
    public void close() throws IOException {
        br.close();
    }
}