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

int main(){
  int N,A,B;
  int sum1=0,sum2=0,sum3=0;
  cin>>N>>A>>B;
  vector<int> P(N);
  for(int i=0;i<N;i++){
    cin>>P.at(i);
    if(P.at(i)<=A)sum1++;
    if(P.at(i)>A&&P.at(i)<=B)sum2++;
    if(P.at(i)>B)sum3++;
  }
  cout<<min(min(sum1,sum2),sum3)<<endl;
  
}