#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;

int a,b,c;
int n,n1,n2;

int main()
{
	scanf("%d%d%d",&n,&n1,&n2);
	for(int i=1; i<=n; i++)
	{
		int x; scanf("%d",&x);
		if(x<=n1) {a++;}
		else if(x>n2) {c++;}
		else {b++;}
	}
	printf("%d\n",min(min(a,b),c));
	return 0;
}