You have created N problems for programming contests, each with a specific score. You want to hold as many contests as possible, with each contest having three problems. The first problem's score must be less than or equal to A, the second's score must be between A+1 and B (inclusive), and the third's score must be greater than or equal to B+1. The same problem cannot be used in multiple contests. Find the maximum number of contests that can be held. The constraints are: 3 ≤ N ≤ 100, 1 ≤ Pi ≤ 20, 1 ≤ A < B < 20, and all input values are integers. The input format is N, A, B, followed by the scores of the N problems. Output the maximum number of contests that can be held.

# Buggy version:
n,a,b=map(int, input().split())
*p,=map(int, input().split())
mn,md,mx=0,0,0
for pi in p:
    if pi<=a:
        mn+=1
    elif pi<=b:
        md+=1
    else:
        mx+=1
print(min(mn,md,mx))


# Fixed version:
n=int(input())
a,b=map(int, input().split())
*p,=map(int, input().split())
mn,md,mx=0,0,0
for pi in p:
    if pi<=a:
        mn+=1
    elif pi<=b:
        md+=1
    else:
        mx+=1
print(min(mn,md,mx))

# Buggy version:
int pxcount,pycount,pzcount=0

n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split()))

for i in p:
  if i<=a:
    pxcount=pxcount+1
for i in p:
  if a+1<=i and i<=b:
    pycount=pycount+1
for i in p:
  if b+1<=i:
    pzcount=pzcount+1
  
print(min(pxcount,pycount,pzcount))

# Fixed version:
pxcount=0
pycount=0
pzcount=0

n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split()))

for i in p:
  if i<=a:
    pxcount=pxcount+1
for i in p:
  if a+1<=i and i<=b:
    pycount=pycount+1
for i in p:
  if b+1<=i:
    pzcount=pzcount+1
  
print(min(pxcount,pycount,pzcount))

# Buggy version:
N=int(input())
A,B=map(int,input().split())
p = list(map(int,input().split()))
c=[]
d=[]
e=[]
for i in range(N):
    if p[i]<=A:
        c.append(p[i])
    if A+1 <= p[i] <= B:
        d.append(p[i])
    if B+1 <= p[i]:
        e.append(p[i])

        
print(min(len(c),len(d),len(e))))


# Fixed version:
N=int(input())
A,B=map(int,input().split())
p = list(map(int,input().split()))
c=[]
d=[]
e=[]
for i in range(N):
    if p[i]<=A:
        c.append(p[i])
    if A+1 <= p[i] <= B:
        d.append(p[i])
    if B+1 <= p[i]:
        e.append(p[i])

        
print(min(len(c),len(d),len(e)))

# Buggy version:
n = int(input())
a,b = map(int, input().split())
p = list(map(int, input().split()))

cnt=[0,0,0]
for poi in p:
  if poi <= a:
  	cnt[0]+=1
  elif poi <=b:
    cnt[1]+=1
  else:
    cnt[2]+=1
print(max(cnt))

# Fixed version:
n = int(input())
a,b = map(int, input().split())
p = list(map(int, input().split()))

cnt=[0,0,0]
for poi in p:
  if poi <= a:
  	cnt[0]+=1
  elif poi <=b:
    cnt[1]+=1
  else:
    cnt[2]+=1
print(min(cnt))

# Buggy version:
n = int(input())
a,b = map(int, input().split())
res = [0,0,0]
arr = list(map(int, input().split()))
for i in range(n):
  if arr[i] <= a:
    res[0] += 1
  elif arr[i] <= b:
    res[1] += 1
  else:
    res[2] += 1
print(min(arr))

# Fixed version:
n = int(input())
a,b = map(int, input().split())
res = [0,0,0]
arr = list(map(int, input().split()))
for i in range(n):
  if arr[i] <= a:
    res[0] += 1
  elif arr[i] <= b:
    res[1] += 1
  else:
    res[2] += 1
print(min(res))

# Buggy version:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a,b = na()
p = na()
c = [0,0,0]

for i in p:
    if i <= a:
        c[0] += 1
    elif a+1 < p <= b:
        c[1] += 1
    else:
        c[2] += 1

print(c)

# Fixed version:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a,b = na()
p = na()
c = [0,0,0]

for i in p:
    if i <= a:
        c[0] += 1
    elif a+1 <= i <= b:
        c[1] += 1
    else:
        c[2] += 1

print(min(c))

# Buggy version:
n=int(input())
a,b=map(int,input().split())
d=[]
e=[]
f=[]
for i in range(n):
    k=int(input())
    if k<=a:
        d.append(k)
    elif a<k<=b:
        e.append(k)
    else:
        f.append(k)
print(min(len(d),len(e),len(f)))

# Fixed version:
n=int(input())
a,b=map(int,input().split())
H=list(map(int,input().split()))
d=[]
e=[]
f=[]
for i in range(n):
    k=H[i]
    if k<=a:
        d.append(k)
    elif a<k<=b:
        e.append(k)
    else:
        f.append(k)
print(min(len(d),len(e),len(f)))

# Buggy version:
import bisect
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
x = bisect.bisect_left(p,a)
y = bisect.bisect_left(p,b)
one = p[:x]
two = p[x:y]
three = p[y:]
print(min(len(one),len(two),len(three)))

# Fixed version:
import bisect
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
x = bisect.bisect_left(p,a+1)
y = bisect.bisect_left(p,b+1)
one = p[:x]
two = p[x:y]
three = p[y:]
print(min(len(one),len(two),len(three)))

# Buggy version:
N = int(input())
A, B = map(int, input().split())
P = listans1 = 0
ans2 = 0
ans3 = 0  
for i in P:
    if A>=i:
        ans1 = ans1 + 1
    if A+1 <= i <= B+1:
        ans2 = ans2 + 1
    if B+1 <= i:
        ans3 = ans3 + 1 


print(min(ans1,ans2,ans3))

# Fixed version:
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
ans1 = 0
ans2 = 0
ans3 = 0  
for i in P:
    if A>=i:
        ans1 = ans1 + 1
    if A+1 <= i <= B:
        ans2 = ans2 + 1
    if B+1 <= i:
        ans3 = ans3 + 1 


print(min(ans1,ans2,ans3))

# Buggy version:
import numpy as np

N = int(input())

A, B = [int(i) for i in input().split()]

P = [int(i) for i in input().split()]



def Three_Categorize(P,A,B):
    count_1 = 0
    count_2 = 0
    count_3 = 0
    for i in P:
        if i <= A:
            count_1 +=1
        elif (i > A) & (i < B):
            count_2 +=1
        elif i > B:
            count_3 +=1
    
    return [count_1, count_2, count_3]
            
    
count = Three_Categorize(P,A,B)
ans=1
for i in count:
    ans = ans*i
    
print(ans)

# Fixed version:
import numpy as np

N = int(input())

A, B = [int(i) for i in input().split()]

P = [int(i) for i in input().split()]



def Three_Categorize(P,A,B):
    count_1 = 0
    count_2 = 0
    count_3 = 0
    for i in P:
        if i <= A:
            count_1 +=1
        elif (i > A) & (i <= B):
            count_2 +=1
        elif i > B:
            count_3 +=1
    
    return [count_1, count_2, count_3]
            
    
count = Three_Categorize(P,A,B)
ans=min(count)
print(ans)

# Buggy version:
#coding:utf-8
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

p1 = 0
p2 = 0
p3 = 0

for i in p:
  if i <= a:
    p1 += 1
  elif i >= (a+1) and i <= b:
    p2 += 1
  elif i >= (b+1)
    p3 += 1

print(min(min(p1, p2), p3))

# Fixed version:
#coding:utf-8
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

p1 = 0
p2 = 0
p3 = 0

for i in p:
  if i <= a:
    p1 += 1
  elif i >= (a+1) and i <= b:
    p2 += 1
  elif i >= (b+1):
    p3 += 1

print(min(min(p1, p2), p3))

# Buggy version:
n = int(input())
a, b = map(int , input().split())
p = list(map(int, input().split()))
group_a = len([i for i in p if i <= a])
group_b = len([i for i in p if i < a and i <= b])
group_c = len([i for i in p if i > b])
print(min( group_a, group_b, group_c))


# Fixed version:
n = int(input())
a, b = map(int , input().split())
p = list(map(int, input().split()))
group_a = len([i for i in p if i <= a])
group_b = len([i for i in p if i > a and i <= b])
group_c = len([i for i in p if i > b])
print(min(group_a, group_b, group_c))

# Buggy version:
def resolve():
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))
    low, mid, high = 0, 0, 0
    for pi in p:
        if pi <= a:
            low += 1
        elif a + 1 <= pi <= a:
            mid += 1
        else:
            high += 1
    print(min(low, mid, high))


if __name__ == "__main__":
    resolve()


# Fixed version:
def resolve():
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))
    low, mid, high = 0, 0, 0
    for pi in p:
        if pi <= a:
            low += 1
        elif a + 1 <= pi <= b:
            mid += 1
        else:
            high += 1
    print(min(low, mid, high))


if __name__ == "__main__":
    resolve()

# Buggy version:
N = int(input())
A,B = map(int,input().split())
*P, = map(int,input().split())

a = len([p for p in P if p<=A])
a = min(a,
        len([p for p in P if A<p<=B])
a = min(a,
        len([p for p in P if B<p])
print(a)

# Fixed version:
N = int(input())
A,B = map(int,input().split())
*P, = map(int,input().split())

a = len([p for p in P if p<=A])
a = min(a,
        len([p for p in P if A<p<=B]))
a = min(a,
        len([p for p in P if B<p]))
print(a)

# Buggy version:
A=input()
A,B=input().split()
P=input().split()
c=[0]*3
for i in P:
        if P <= A:c[0]+=1
        elif P <= B:c[1]+=1
        else :c[2]+=1
c.sort()
print(c[0])

# Fixed version:
A=input()
A,B=input().split()
A=int(A)
B=int(B)
P=input().split()
c=[0]*3
for i in P:
        i=int (i)
        if i <= A:
                c[0]+=1
        elif i <= B:
                c[1]+=1
        else :
                c[2]+=1
c.sort()
print(c[0])

# Buggy version:
n = int(input())
a,b = map(int,input().split())
p = [int(x) for x in input().split()]

p.sort()

p1 = [i for i in p if i<=a]
p2 = [j for j in p if a<j<=b]
p3 = [k for k in p if b<k]

print(min([p1,p2,p3]))


# Fixed version:
n = int(input())
a,b = map(int,input().split())
p = [int(x) for x in input().split()]

p.sort()

p1 = [i for i in p if i<=a]
p2 = [j for j in p if a<j<=b]
p3 = [k for k in p if b<k]

print(min([len(p1),len(p2),len(p3)]))

# Buggy version:
a = int(input())
b,c = map(int,input().split())
lis = input().split()

li = [int(l) for l in lis]

judge = True

d = 0

li.sort()

while judge:
    
    s = []
    s.append(min(li))
    li.remove(min(li))

    for n in li:
        if n >= b+1 and n<=c:
            s.append(n)
            li.remove(n)
            break
        else:judge = False

    for n in li:
        if n>=c+1:
            s.append(n)
            li.remove(n)
            break
        else:
            judge= False

    if len(s) == 3:
        d+=1
        judge = True
    else:judge=False

print(d)

# Fixed version:
a = int(input())
b,c = map(int,input().split())
lis = input().split()

li = [int(l) for l in lis]

judge = True

d = 0

li.sort()

while judge:
    if li == []:
        break
    
    s = []
    for n in li:
        if n <= b:
            s.append(n)
            li.remove(n)
            break
        else:judge = False

    for n in li:
        if n >= b+1 and n<=c:
            s.append(n)
            li.remove(n)
            break
        else:judge = False

    for n in li:
        if n>=c+1:
            s.append(n)
            li.remove(n)
            break
        else:
            judge= False

    if len(s) == 3:
        d+=1
        judge = True
    else:judge=False

print(d)

# Buggy version:
n=int(input())
a,b=map(int,input().split())
p=[int(i) for i in input().split()]
cnta=0
cntb=0
cntc=0
for i in p:
  if i<=a:
    cnta+=1
  elif i<=b:
    cntb+=1
  else:
    cntc+=1
print(cnta*cntb*cntc)

# Fixed version:
n=int(input())
a,b=map(int,input().split())
p=[int(i) for i in input().split()]
cnta=0
cntb=0
cntc=0
for i in p:
  if i<=a:
    cnta+=1
  elif i<=b:
    cntb+=1
  else:
    cntc+=1
print(min(cnta,cntb,cntc))

# Buggy version:
# _*_ coding:utf-8 _*_
#  Atcoder_AISingProgramming_Contest-B
#  TODO https://aising2019.contest.atcoder.jp/tasks/aising2019_b

def solveProblem(problemSeed,FirstScore,SecondScore,ScoreList):
	firstBarrier = 0
	secondBarrier = 0
	lastBarrier = 0
	for problemNo in range(0,len(ScoreList),+1):
		problemScore = ScoreList(problemNo)
		if problemScore <= FirstScore:
			firstBarrier = firstBarrier + 1
		elif ( FirstScore+1 <= problemScore ) and ( problemScore <= SecondScore):
			secondBarrier = secondBarrier + 1
		else : # secondScore + 1 <= problemScore
			lastBarrier = lastBarrier + 1
	problemPattern = firstBarrier * secondBarrier * lastBarrier
	answer = problemPattern
	return answer


if __name__ == '__main__':
	N = int(input().strip())
	A,B = map(int,input().strip().split(' '))
	Ps = list(map(int,input().strip().split(' ')))
	solution = solveProblem(N,A,B,Ps)
	print("{}".format(solution))


# Fixed version:
# _*_ coding:utf-8 _*_
#  Atcoder_AISingProgramming_Contest-B
#  TODO https://aising2019.contest.atcoder.jp/tasks/aising2019_b

def solveProblem(problemSeed,FirstScore,SecondScore,ScoreList):
	firstBarrier = 0
	secondBarrier = 0
	lastBarrier = 0
	for problemNo in range(0,len(ScoreList),+1):
		problemScore = ScoreList[problemNo]
		if problemScore <= FirstScore:
			firstBarrier = firstBarrier + 1
		elif ( FirstScore+1 <= problemScore ) and ( problemScore <= SecondScore):
			secondBarrier = secondBarrier + 1
		else : # secondScore + 1 <= problemScore
			lastBarrier = lastBarrier + 1
	problemPattern = min(firstBarrier, secondBarrier,lastBarrier)
	answer = problemPattern
	return answer


if __name__ == '__main__':
	N = int(input().strip())
	A,B = map(int,input().strip().split(' '))
	Ps = list(map(int,input().strip().split(' ')))
	solution = solveProblem(N,A,B,Ps)
	print("{}".format(solution))

# Buggy version:
N = int(input())
A, B = [int(_) for i in input().split()]
P =  [int(_) for i in input().split()] 
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i <= B])

if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)

# Fixed version:
N = int(input())
A, B = [int(_) for _ in input().split()]
P =  [int(_) for _ in input().split()]
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i >= B + 1])
 
if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)

# Buggy version:
N = int(input())
A,B = map(int,input().split())

lis = []

P = list(map(int,input().split()))

for i in P:
  if i <= A:
    lis[0] += 1
  elif i <= B:
    lis[1] += 1
  else:
    lis[2] += 1
    
print (min(lis))

# Fixed version:
N = int(input())
(A, B) = list(map(int, input().split()))
P = list(map(int, input().split()))
COUNT = [0, 0, 0]
for i in sorted(P):
    if i <= A:
        COUNT[0] += 1
    elif i <= B:
        COUNT[1] += 1
    else:
        COUNT[2] += 1
print(min(COUNT))

# Buggy version:
n=int(input())
a,b = map(int,input().split())
p = map(int,input().split())

print(p)

list1 = []
list2 = []
list3 = []

for i in p:
    if i<=a:
        list1.append(i)
    elif i<=b:
        list2.append(i)
    else:
        list3.append(i)


if len(list1)>=len(list2):
    if len(list2)>=len(list3):
        print(len(list3))
    else:
        print(len(list2))
else:
    if len(list1)>=len(list3):
        print(len(list3))
    else:
        print(len(list1))

# Fixed version:
n=int(input())
a,b = map(int,input().split())
p = map(int,input().split())



list1 = []
list2 = []
list3 = []

for i in p:
    if i<=a:
        list1.append(i)
    elif i<=b:
        list2.append(i)
    else:
        list3.append(i)


if len(list1)>=len(list2):
    if len(list2)>=len(list3):
        print(len(list3))
    else:
        print(len(list2))
else:
    if len(list1)>=len(list3):
        print(len(list3))
    else:
        print(len(list1))

# Buggy version:
N = int(input())
A,B=(int(x) for x in input().split())
scores = input().split()
num = [0,0,0]
for i in range(N):
    score = int(scores[i])
    if (score <= A):
        num[0] += 1
    elif(score <= B):
        num[1] += 1
    else:
        num[2] +=1
max_value = 0
for i in range(3):
    if max_value < num[i]:
        max_value = num[i]
print(max_value)

# Fixed version:
N = int(input())
A,B=(int(x) for x in input().split())
scores = input().split()
num = [0,0,0]
for i in range(N):
    score = int(scores[i])
    if (score <= A):
        num[0] += 1
    elif(score <= B):
        num[1] += 1
    else:
        num[2] += 1
max_value = num[2]
for i in range(2):
    if max_value > num[i]:
        max_value = num[i]
print(max_value)

# Buggy version:
# B
N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]
#print(N,A,B)#
#print(P)#
P.sort()
for i in range(N):
    if P[i]>A: break
a = i # A 以下の枚数
for i in range(A+1,N):
    if P[i]>B: break
b = i - a # B以下の枚数
#print(a,b)#
#count = min(a+1, b-a+1, N-b)
count = min(a, b, N-(b+a))
print(count)



# Fixed version:
# B
N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]
#print(N,A,B)#
P.sort()
#print(P)#

for i in range(N):
    if P[i]>A: break
a = i # A 以下の枚数
for i in range(a,N):
    if P[i]>B: break
else:
    i = N
b = i - a # A+1以上B以下の枚数
c = N - i
#print(a,b,c)#
#count = min(a+1, b-a+1, N-b)
count = min(a, b, c)
print(count)

# Buggy version:
N = int(input())
A, B = list(map(int, input().split()))
P = list(map(int, input().split()))

P.sort()

c1, c2, c3 = 0, 0, 0
for i, p in enumerate(P, 1):
    if p <= A:
        c1 = i
    if (p > A) and (p <= B):
        c2 = i
    if p > B:
        c3 = i

print(c1, c2, c3)
print(min((c1), (c2 - c1), (c3 - c2)))


# Fixed version:
N = int(input())
A, B = list(map(int, input().split()))
P = list(map(int, input().split()))

P.sort()

c1, c2, c3 = 0, 0, 0
for i, p in enumerate(P, 1):
    if p <= A:
        c1 = i
    if (p > A) and (p <= B):
        c2 = i
    if p > B:
        c3 = i


if c1 <= c2 <= c3:
    print(min((c1), (c2 - c1), (c3 - c2)))
else:
    print(0)

# Buggy version:
N = int(input())
A,B = map(int,input().split())
p = list(map(int,input().split()))
cntA = 0
cntB = 0
cntC = 0

for i in range(N):
    if int(p[i]) <= int(A):
        cntA += 1
    if int(p[i]) >= int(B)+1:
        cntB += 1
    if int(p[i]) >= int(A)+1 and int(p[i]) < int(B):
        cntC += 1

print(min(cntA,cntB,cntC))


# Fixed version:
N = int(input())
A,B = map(int,input().split())
p = list(map(int,input().split()))
cntA = 0
cntB = 0
cntC = 0

for i in range(N):
    if int(p[i]) <= int(A):
        cntA += 1
    if int(p[i]) >= int(B)+1:
        cntB += 1
    if int(p[i]) >= int(A)+1 and int(p[i]) <= int(B):
        cntC += 1

print(min(cntA,cntB,cntC))

# Buggy version:
# -*- coding: utf-8 -*-


def solve():
    N = int(input())
    A,B  = map(int,input().split())
    P = list(map(int,input().split()))
    P1 = list(p for p in P if p<=A)
    P2 = list(p for p in P if A<p<=B)
    P3 = list(p for p in P if B<p)
    res = min(P1,P2,P3)
    return str(res)

if __name__ == '__main__':
    print(solve())

# Fixed version:
# -*- coding: utf-8 -*-


def solve():
    N = int(input())
    A,B  = map(int,input().split())
    P = list(map(int,input().split()))
    P1 = list(p for p in P if p<=A)
    P2 = list(p for p in P if A<p<=B)
    P3 = list(p for p in P if B<p)
    res = min(len(P1),len(P2),len(P3))
    return str(res)

if __name__ == '__main__':
    print(solve())

# Buggy version:
N = int(input())
A, B = map(int,input().split())
list = [int(x) for x in input().split()]
counta = 0
countb = 0
countc = 0 
for p in list:
    if p < A:
        counta += 1
    elif B > p >= A+1:
        countb += 1
    elif p >= B+1:
        countc +=1
print(min(min(counta,countb),countc))

# Fixed version:
N = int(input())
A, B = map(int,input().split())
list = [int(x) for x in input().split()]
counta = 0
countb = 0
countc = 0 
for p in list:
    if p <= A:
        counta += 1
    elif B >= p >= A+1:
        countb += 1
    elif p >= B+1:
        countc +=1
print(min(min(counta,countb),countc))

# Buggy version:
import math
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
n=nCast(input())
ab=nCast(input().split())
p=nCast(input().split())
x,y,z=0,0,0
for number in p:
    if number<ab[0]:
        x+=1
    elif number>ab[1]:
        z+=1
    else:
        y+=1
print(min(x,y,z))


# Fixed version:
import math
def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
n=nCast(input())
ab=nCast(input().split())
p=nCast(input().split())
x,y,z=0,0,0
for number in p:
    if number<=ab[0]:
        x+=1
    elif number>ab[1]:
        z+=1
    else:
        y+=1
print(min(x,y,z))

# Buggy version:
N=int(input())
A,B  = list(map(int, input().split()))
lis = list(map(int, input().split())))
lis_1=[]
lis_2=[]
lis_3=[]
for i in lis:
   if i <= A:
      lis_1.append(i)
   elif i > A and i <=B:
      lis_2.append(i)
   else:
      lis_3.append(i)

print(min[len(lis_1),len(lis_2),len(lis_3)])

# Fixed version:
N=int(input())
A,B  = list(map(int, input().split()))
lis = list(map(int, input().split()))
lis_1=[]
lis_2=[]
lis_3=[]
for i in lis:
    if i <= A:
       lis_1.append(i)
    elif i > A and i <=B:
       lis_2.append(i)
    else:
       lis_3.append(i)

print(min([len(lis_1),len(lis_2),len(lis_3)]))

# Buggy version:
N = int(input())
A, B = map(int, input().split())
P = [i for i in map(int, input().split())]

P.sort()

print(P)

p_1 = list(filter(lambda x: x<=A, P))
p_2 = list(filter(lambda x: A < x <= B, P))
p_3 = list(filter(lambda x: B <x, P))

print(min(len(p_1), len(p_2), len(p_3)))


# Fixed version:
N = int(input())
A, B = map(int, input().split())
P = [i for i in map(int, input().split())]

P.sort()


p_1 = list(filter(lambda x: x<=A, P))
p_2 = list(filter(lambda x: A < x <= B, P))
p_3 = list(filter(lambda x: B <x, P))

print(min(len(p_1), len(p_2), len(p_3)))

# Buggy version:
n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split())
c=[0,0,0]
for i in p:
       if i <=a:
        c[0] +=1
       elif i>b:
        c[2] +=1
       else:
        c[1]+=1
print(min(c))

# Fixed version:
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))

c = [0] * 3

for i in p:
    if i <= a:
        c[0] += 1
    elif i <= b:
        c[1] += 1
    else:
        c[2] += 1

print(min(c))

# Buggy version:
n = int(input())
a, b = map(int, input().split())
p = list(map(int,input().split()))
x = 0
y = 0
z = 0
        
for i in range(n):
  if p[i] < a:
    x = x + 1
  if a < p[i] < b:
    y = y + 1
  else:
    z = z+1

print(min(x, y, z))

# Fixed version:
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))

x = 0
y = 0
z = 0
for i in range(n):
    if (p[i]<=a):
        x += 1
    elif (a+1 <= p[i]<= b):
        y += 1
    else:
        z += 1

print(min(x,y,z))

# Buggy version:
n=int(input())
a,b = list(map(int, input().split()))
p = list(map(int, input().split()))

q = list([0,0,0])
for i in p:
    if i <= a:
        q[0] += 1
    elif i >= b:
        q[2] += 1
    else:
        q[1] +=1

print(min(q))


# Fixed version:
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))
ans = [0,0,0]
for i in p:
    if i<=a:
        ans[0] +=1
    elif i<= b:
        ans[1] += 1
    else:
        ans[2] += 1
print(min(ans))

# Buggy version:
n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split())
c=[0]*3
for i in p:
       if i <=a:
        c[0] +=1
       elif i>b:
        c[2] +=1
       else:
        c[1]+=1
print(min(c))

# Fixed version:
n = int(input())
a,b = map(int,input().split())
p = list(map(int,input().split()))

r = [0]*3
for i in p:
    if i <= a:
        r[0] += 1
    elif i <= b:
        r[1] += 1
    else:
        r[2] += 1
print(min(r))