/**
 * @author      : Simanta Deb Turja
 * @created     : 11/01/2019
 */

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

#define TIME    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define FASTIO  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL)
#define READ    freopen("in.txt","r",stdin)
#define WRITE   freopen("out.txt","w",stdout)


#define   MAXN  1005
#define   MOD   1000000007
#define   pii   pair <int, int>
#define   pli   pair <ll, int>
#define   pil   pair <int, ll>
#define   mk    make_pair
#define   p4i   pair < pair <int, int> , pair <int, int> >

#define   input(n)          scanf("%d",&n)
#define   inputII(x, y)     scanf("%d %d", &x, &y)
#define   inputL( x )       scanf("%lld", &x)
#define   inputLL( x, y )   scanf("%lld %lld", &x, &y)

#define   mem0(n)           memset( n, 0, sizeof( n ) )
#define   mem1(n)           memset( n, 1, sizeof( n ) )
#define   clr(n)            memset( n, -1, sizoef( n ) )

#define   all(x)            (x).begin(), (x).end()

#define   NUMDIGIT(num,b)   (((ll)(log10((num))/log10((b))))+1)

//int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 Direction
//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction
//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction

//FAST READ
template<class T>inline bool read(T &x) {
  int c = getchar();
  int sgn=1;
  while(~c&&c<'0'|c>'9') {
    if(c=='-')sgn=-1;
      c=getchar();
  }
  for(x=0; ~c&&'0'<=c&&c<='9'; c=getchar())x=x*10+c-'0';
  x*=sgn;
  return ~c;
}

template<class T> inline int gcd ( T a, T b ) {
  a = abs ( a ); b = abs ( b );
  while ( b ) { a = a % b; swap ( a, b ); } return a;
}

template<class T> inline ll ext_gcd ( T A, T B, T *X, T *Y ) {
  T x2, y2, x1, y1, x, y, r2, r1, q, r;
  x2 = 1; y2 = 0;
  x1 = 0; y1 = 1;
  for (r2 = A,r1 = B;r1 != 0;r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
    q = r2 / r1;
    r = r2 % r1;
    x = x2 - (q * x1);
    y = y2 - (q * y1);
  }
  *X = x2; *Y = y2;
  return r2;
}

template<class T> inline ll modInv ( T a, T m ) {
  T x, y;
  ext_gcd( a, m, &x, &y );
  x %= m;
  if ( x < 0 ) x += m; //modInv is never negative
  return x;
}

template<class T> inline ll power ( T a, T p ) {
  T res = 1, x = a;
  while ( p ) { if ( p & 1 ) res = ( res * x ); x = ( x * x ); p >>= 1; }
  return res;
}

inline ll bigmod ( ll a, ll p, ll m ) {
  ll res = 1 % m, x = a % m;
  while ( p ) { if ( p & 1 ) res = ( res * x ) % m; x = ( x * x ) % m; p >>= 1; }
  return res;
}
inline ll modInverse ( ll a, ll m ) {
  return bigmod(a, m-2, m);
}
/* Template ends here */
int res[1000005], ans[11][1000005];
void solve() {
  res[1] = 0;
  for ( int i = 2; i <= 1000005; i++ ) {
    if ( res[i] == 0 ) {
      for ( int j = i; j <= 1000005; j += i ) res[j]++;
    }
  }
  for ( int i = 0; i <= 10; i++ ) {
    for ( int j = 1; j <= 1000005; j++ ) {
      if ( res[j] == i ) ans[i][j] = ans[i][j-1] + 1;
      else ans[i][j] += ans[i][j-1];
    }
  }
}
int arr[110], used[110];
int main()
{
  #ifdef __APPLE__
    //READ;
    //WRITE;
  #endif
  //FASTIO;
  int n, a, b;
  scanf("%d %d %d", &n, &a, &b);
  for ( int i = 0; i < n; i++ ) scanf("%d", &arr[i]);
  sort(arr, arr+n);
  int cnt = 0;
  int taken = 0;
  for ( int i = 0; i < n; i++ ) {
    if ( used[i] ) continue;
    for ( int j = 0; j < n; j++ ) {
      if ( used[j] ) continue;
      if ( taken == 0 ) {
        if ( arr[j] <= a ) {
          taken++;
          used[j] = 1;
        }
      }
      if ( taken == 1 ) {
        if ( arr[j] > a && arr[j] <= b ) {
          taken++;
          used[j] = 1;
        }
      }
      if ( taken == 2 ) {
        if ( arr[j] > b ) {
          taken++;
          used[j] = 1;
        }
      }
      if ( taken == 3 ) {
        taken = 0;
        cnt++;
      }
    }
  }
  cout << cnt << endl;
  #ifdef __APPLE__
    TIME;
  #endif
  return 0;
}


Measured memory_bytes: 256