function main(arg) {
    var tmp = arg.split("\n");
    var N = parseInt(tmp[0]);
    var A = tmp[1].split(" ").map(n=>parseInt(n))[0];
    var B = tmp[1].split(" ").map(n=>parseInt(n))[1];
    var points = tmp[2].split(" ").map(n=>parseInt(n));
    var Q = [];
    
    Q.push(points.filter(i=> i <= A).length);
    Q.push(points.filter(i=> A < i && i <= B).length);
    Q.push(points.filter(i=> B < i).length);
    
    console.log(Math.min(...Q));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
