#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,v1,v2,num1,num2,num3;
int main()
{
	scanf("%d",&n);
	scanf("%d%d",&v1,&v2);
	while(n--)
	{
		int v;
		scanf("%d",&v);
		if(v<=v1)num1++;
		else if(v<=v2)num2++;
		else num3++;
	}
	printf("%d\n",min(num1,min(num2,num3)));
	return 0;
}