#include <iostream>
using namespace std;

int N,A,B,P[110];

int main(){
	cin >> N >> A >> B;
	int a = 0,ab = 0,b = 0;
	for(int i=0;i<N;i++){
		cin >> P[i];
		if(P[i]<=A) a++;
		else if(P[i]>=B+1) b++;
		else ab++;
	}
	cout << min(a,min(ab,b)) << endl;
}