#include<bits/stdc++.h>
using namespace std;
int A,B,a,b,c,n;
int main()
{
	cin>>n>>A>>B;
	for(int i=0;i<n;i++)
	{
		int x;
		cin>>x;
		if(x<=A)a++;
		else if(x>A&&x<=B)b++;
		else c++;
	}
	cout<<min(a,min(b,c));
	return 0;
}