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

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int p, x1 = 0, x2 = 0, x3 = 0;
  for (int i = 0; i < N; i++) {
    cin >> p;
    if (p <= A) x1++;
    else if (p <= B) x2++;
    else x3++;
  }
  cout << min({x1, x2, x3}) << endl;
}