unittest
{
	assert( [ "7", "5 15", "1 10 16 2 7 20 12" ].parse.expand.solve == 2 );
	assert( [ "8", "3 8", "5 5 5 10 10 10 15 20" ].parse.expand.solve == 0 );
	assert( [ "3", "5 6", "5 6 10" ].parse.expand.solve == 1 );
}



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

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto ab = input.front.split.to!( long[] );
	input.popFront;
	auto ps = input.front.split.to!( long[] );
	return tuple( ab[ 0 ], ab[ 1 ], ps );
}

auto solve( long a, long b, long[] ps )
{
	auto ts = new long[ 3 ];
	
	foreach( p; ps )
	{
		if(      p <= a          ) ts[ 0 ]++;
		else if( a < p && p <= b ) ts[ 1 ]++;
		else                       ts[ 2 ]++;
	}
	
	return ts.reduce!min;
}
