function main(input) {
    var lines = input.split('\n');
    var line1 = lines[0].split(' ');
    var line2 = lines[1].split(' ');

    var N = parseInt(line1[0]);
    var M = parseInt(line1[1]);
    var X = parseInt(line1[2]);

    var tollgates = line2.map(function(str){return parseInt(str)});

    var costBeforeX = tollgates.reduce(function(cost, place){
        return place <= X ? cost + 1 : cost;
    }, 0);

    var costAfterX = M - costBeforeX;

    var answer = Math.min(costBeforeX, costAfterX);
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));