#include <bits/stdc++.h>

using namespace std;

int main() {
	int n, a, b, x = 0, y = 0, z = 0;
	cin >> n >> a >> b;
	for (int i = 0; i < n; i++) {
		int p;
		cin >> p;
		if (p > b) x++;
		else if (p > a) y++;
		else z++;
	}
	cout << min(min(x, y), z) << endl;
	return 0;
}
