#include "bits/stdc++.h"
using namespace std;

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	int p;
	int A = 0, B = 0, C = 0;
	for ( int i = 0; i < n; i++ ) {
		cin >> p;
		if ( p <= a ) A++;
		else if ( p <= b ) B++;
		else C++;
	}

	cout << min(A, min(B, C)) << endl;

}
