#include<iostream>
using namespace std;
int main(){
	int n,a,b,p,aa=0,bb=0,cc=0;
	cin>>n>>a>>b;
	for(int i=0;i<n;++i){
		cin>>p;
		if(p<=a)
			++aa;
		else if(p<=b)
			++bb;
		else
			++cc;
	}
	if(aa<=bb&&aa<=cc)
		cout<<aa;
	else if(bb<=aa&&bb<=cc)
		cout<<bb;
	else if(cc<=aa&&cc<=bb)
		cout<<cc;
	return 0;
}