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;

    auto n1 = ps.count!(e => e <= a);
    auto n2 = ps.count!(e => a < e && e <= b);
    auto n3 = ps.count!(e => e > b);
    writeln(min(n1, n2, n3));
}
