import std.stdio;
import std.string;
import std.conv;
import std.array;

void main()
{
    int N = readln.chomp.to!int;
    auto buf = readln.split;
    int A = buf[0].to!int;
    int B = buf[1].to!int;
    int[] P = readln.split.to!(int[]);

    int[] cnt = [0, 0, 0];
    foreach (i; 0..N){
        if (P[i] <= A){
            cnt[0]++;
        }
        else if (P[i] <= B){
            cnt[1]++;
        }
        else {
            cnt[2]++;
        }
    }

    int min_cnt = cnt[0];
    foreach (i; 1..3){
        if (cnt[i] < min_cnt) min_cnt = cnt[i];
    }

    writeln(min_cnt);
}

