from numpy import*;n,a,b,*p=list(map(int,open(0).read().split()));c=array(p);print((min(len(c[c<=a]),len(c[(a<c)&(c<=b)]),len(c[b<c]))))
from numpy import*;n,a,b,*p=list(map(int,open(0).read().split()));c=array(p);print((min(sum(c<=a),sum((a<c)&(c<=b)),sum(b<c))))
from numpy import *

n, a, b, *p = list(map(int, open(0).read().split()))
c = array(p)
print((min(len(c[c <= a]), len(c[(a < c) & (c <= b)]), len(c[b < c]))))

from numpy import *

n, a, b, *p = list(map(int, open(0).read().split()))
c = array(p)
print((min(sum(c <= a), sum((a < c) & (c <= b)), sum(b < c))))

-print((min(len(c[c <= a]), len(c[(a < c) & (c <= b)]), len(c[b < c])))) +print((min(sum(c <= a), sum((a < c) & (c <= b)), sum(b < c))))