#include<bits/stdc++.h>
using namespace std;
int ap=0;
int atbp=0;
int bp=0;
int main()
{
	int n;
	int a,b;
	scanf("%d %d %d",&n,&a,&b);
	for(int i=0;i<n;i++)
	{
		int t;
		scanf("%d",&t);
		if(t<=a)
			ap++;
		else if(t<=b)
			atbp++;
		else 
			bp++;
	}
	printf("%d",min(ap,min(atbp,bp)));
	return 0;
}