#include<bits/stdc++.h>
using namespace std;
#define ll int long long
#define mp make_pair
//#define for(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define N 1000000007
#define pq priority queue
#define pb push_back
#define mt make_tuple
#define prec(a) fixed<<setprecision(9)<<a
#define endl "\n"
#define fast_set s.max_load_factor(0.25);s.reserve(500);
const long double PI = (long double)(3.1415926535897932384626433832795);
int parity_check(int n)
{
	int par=n;
	par = par ^ (par >> 1); 
    par = par ^ (par >> 2); 
    par = par ^ (par >> 4); 
    par = par ^ (par >> 8); 
    par = par ^ (par >> 16); 
  
    if(par%2==1)
    {
    	return 1;
    }
    else
    {
    	return 0;
    }
    // true means odd parity
    // false means even parity
}
ll gcd(ll a,ll b)
{
	if(a==0)
	{
		return b;
	}
	return gcd(b%a,a);
}
int sz[100001];
ll lcm(ll a,ll b)
{
	ll pro=a*b;
	ll ans=gcd(a,b);
	pro=pro/ans;
	return pro;
}
ll fast_power(ll a,ll b,ll p)
{
	if(b==0)
	{
		return (1%p);
	}
	ll t=fast_power(a,b/2,p);
	ll ans=(t*t)%p;
	if(b%2)
	{
		ans=(ans*(a%p))%p;
	}
	return ans;
}

void dfs(int s,bool visited[],vector<int> v[])
{
	visited[s]=true;
	for(int i=0;i<v[s].size();i++)
	{
		if(!visited[v[s][i]])
		{
			visited[v[s][i]]=true;
			dfs(v[s][i],visited,v);
			sz[s] = sz[v[s][i]]+sz[s];
		}
	}
	sz[s]=sz[s]+1;
}

void dfs2(int s,bool visited[],vector<int> v[],int dest,int *save,set<int> &save_set,int count)
{
	visited[s]=true;
	if((*save)==0)
		save_set.insert(s);

	for(int i=0;i<v[s].size();i++)
	{
		if(v[s][i]==dest&&(*save)==0)
		{
			(*save)=count+1;
		}
		if(!visited[v[s][i]])
		{
			visited[v[s][i]]=true;
			count++;
			dfs2(v[s][i],visited,v,dest,save,save_set,count+1);
			//sz[s] = sz[v[s][i]]+sz[s];
		}
	}
	//sz[s]=sz[s]+1;
	if((*save)==0)
		save_set.erase(s);
	count--;
}
int main()
{
	fast;
	
	int n,a,b,i,j;
	cin>>n>>a>>b;
	int arr[n];
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	int count1=0,count2=0,count3=0;
	for(i=0;i<n;i++)
	{
		if(arr[i]<=a)
		{
			count1++;
		}
		if(arr[i]>a&&arr[i]<=b)
		{
			count2++;
		}
		if(arr[i]>b)
		{
			count3++;
		}
	}
	cout<<min(count1,min(count2,count3));


	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
	return 0;
}