import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math;
int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.to!(int[]); }


void main() {
    int n, m, x; readf("%d %d %d\n", &n, &m, &x);
    int[] a = readints();

    int l, r;
    foreach (i; a) {
        (i < x ? l : r) += 1;
    }

    writeln(min(l, r));

    auto _ = readln(); // dbg
}