#include<bits/stdc++.h>
using namespace std;
int n,a,b;
long long s1,s2,s3;
int main()
{
	cin>>n>>a>>b;
	for(int i=1,x;i<=n;i++)
	{
		cin>>x;
		if(x<=a)s1++;
		else if(x>b)s3++;
		else s2++;
	}
	cout<<min(s1,min(s2,s3))<<endl;
}