import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    readint;
    auto ab = readints;
    int a = ab[0], b = ab[1];
    auto ps = readints;

    int x = 0, y = 0, z = 0;
    foreach (p; ps) {
        if (p <= a) x++;
        else if (p <= b) y++;
        else z++;
    }
    writeln(min(x, y, z));
}
