#include<cstdio>
#include<iostream>
using namespace std;
int n,h,w,a,b,x,y,z;
int main()
{
	cin>>n>>a>>b;
	for(int i=0;i<n;i++)
	{
		int k;
		cin>>k;
		if(k<=a) x++;
		else if(k>b) z++;
		else y++;
	}
	cout<<min(min(x,y),z);
}