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

signed main(){
  int N,A,B;
  cin>>N>>A>>B;
  int a,b,c;
  a=b=c=0;int k;
  for(int i=0;i<N;i++){
    cin>>k;
    if(k<=A)a++;
    else if(k>B)b++;
    else c++;
  }
  cout<<min(a,min(b,c))<<endl;
}
