#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
int main()
{
	int n,i,j,k,a,b;
	cin>>n>>a>>b;
	int p[n];
	int ca=0,cb=0,cc=0;
	for (i=0;i<n;i++)
	{
		cin>>p[i];
		if (p[i]<=a)
		ca++;
		else if (p[i]>b)
		cc++;
		else
		cb++;
	}
	cout<<min(ca,min(cb,cc));	
}