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

int main(){
  int n,a,b,cur,a1=0,a2=0,a3=0;
  cin >> n >> a >> b;
  for(int i=0; i<n; i++){
    cin >> cur;
    if(cur<=a){ a1++;}
    else if(cur<=b){
      a2++;}
    else{
      a3++;
    }
  }
  cout << min(min(a1,a2),a3) << endl;
}