function main(input) {
    var n = input[0].split(" ")[0]-0;
    var m = input[0].split(" ")[1]-0;
    var x = input[0].split(" ")[2]-0;
    var list = input[1].split(" ").map(v=>v-0);
    var a = 0, b=0;
    list.forEach(v=>{
        if(v<x) a++;
        else b++;
    });
    console.log(Math.min(a,b));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
