function Main(input){
    input = input.split("\n");
    var mem = input[0].split(" ").map(Number);
    var arr = input[1].split(" ").map(Number);
    var x= mem[2];
    var a = 0,b=0;
    for(var i=0;i<arr.length;i++){
        if(arr[i]<x)a++;
        else b++;
    }
    console.log(Math.min(a,b))
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());