import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	auto n = read.to!long;
	auto a = read.to!long;
	auto b = read.to!long;
	
	long[] ps;
	foreach(i; 0 .. n) ps ~= read.to!long;
	
	long c1, c2, c3;
	foreach(p; ps){
		if(p <= a) c1 += 1;
		else if(p <= b) c2 += 1;
		else c3 += 1;
	}
	
	long ans = n;
	if(c1 < ans) ans = c1;
	if(c2 < ans) ans = c2;
	if(c3 < ans) ans = c3;
	if(ans == n) ans = 0;
	
	ans.writeln;
}
