#include <iostream>
#include <algorithm>
using namespace std;

int n, a, b, p, q, r;

int main()
{
	cin >> n >> a >> b;
	for (int i = 0; i < n; i++)
	{
		int l;
		cin >> l;
		if (l <= a)
			p++;
		else if (l <= b)
			q++;
		else
			r++;
	}
	cout << min(min(p, q), r) << endl;
}