#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n, a, b;
	cin >> n >> a >> b;
	
	int l1 = 0, l2 = 0, l3 = 0;
	
	while(n--)
	{
		int x;
		cin >> x;
		
		if(x <= a)
			l1++;
		else
			if(x <= b)
				l2++;
			else
				l3++;
	}
	
	cout << min(l1, min(l2, l3));
}