Problem:
 Score : 200 points    Problem Statement You have written N problems to hold programming contests.
The i -th problem will have a score of P_i points if used in a contest.  With these problems, you would like to hold as many contests as possible under the following condition:   A contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points.   The same problem should not be used in multiple contests.
At most how many contests can be held?      Constraints  3 \leq N \leq 100  1 \leq P_i \leq 20 ( 1 \leq i \leq N )  1 \leq A < B < 20  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  A  B  P_1  P_2  ...  P_N       Output Print the answer.        Sample Input 1 7
5 15
1 10 16 2 7 20 12      Sample Output 1 2  Two contests can be held by putting the first, second, third problems and the fourth, fifth, sixth problems together.       Sample Input 2 8
3 8
5 5 5 10 10 10 15 20      Sample Output 2 0  No contest can be held, because there is no problem with a score of A = 3 or less.       Sample Input 3 3
5 6
5 6 10      Sample Output 3 1

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = [int(i) for i in input().split()]

cnt1 = 0
cnt2 = 0
cnt3 = 0

for p in P:
    if p <= A:
        cnt1 += 1
    elif p <= B:
        cnt2 += 1
    else:
        cnt3 += 1

print(min(cnt1, cnt2, cnt3))

Solution (Python):
while(True):
    try:
        n = int(input())
        a, b = map(int, input().split())
        list = map(int, input().split())
        a_count, b_count, c_count = [0 for _ in range(3)]
        for num in list:
            if num <= a:
                a_count += 1
            elif num > b:
                c_count += 1
            else:
                b_count += 1
        print(min(a_count, b_count, c_count))
    except EOFError:
        exit()

Solution (Python):
N = int(input())
A, B = map(int, input().split())
scores = list(map(int, input().split()))

na, nb, nc = 0, 0, 0
for i in scores:
  if i <= A:
    na += 1
  elif i <= B:
    nb += 1
  else:
    nc += 1
    
print(min(na,nb,nc))

Solution (Python):
def main():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, input().split()))
    p1 = 0
    p2 = 0
    p3 = 0
    for p in P:
        if p <= A:
            p1 += 1
        elif p <= B:
            p2 += 1
        else:
            p3 += 1
    print(min(p1, p2, p3))


if __name__ == "__main__":
    main()

Solution (Python):
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))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
p = list(map(int, input().split()))
p = sorted(p)

aa = 0
bb = 0
cc = 0
for i in range(N):
    if p[i] <= A:
        aa += 1
    elif p[i] <= B:
        bb += 1
    else:
        cc += 1

print(min(aa, bb, cc))

Solution (Python):
N = int( input())
A, B = map( int, input().split())
P = list( map( int, input().split()))
X = Y = Z = 0
for i in range(N):
    if P[i] <= A:
        X += 1
    elif P[i] <= B:
        Y += 1
    else:
        Z += 1
print( min( [X,Y,Z]))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
p_list = list(map(int, input().split()))

first, second, third = [], [], []
for idx, p in enumerate(p_list):
    if p < A+1:
        first.append(idx)
    elif p < B+1:
        second.append(idx)
    elif p > B:
        third.append(idx)
print(min([len(first), len(second), len(third)]))

Solution (Python):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
c1=0;c2=0;c3=0
for i in range(n):
  if p[i]<=a:c1+=1
  elif p[i]>=b+1:c3+=1
  else:c2+=1
print(min(c1,c2,c3))

Solution (Python):
N = int(input())
A,B = map(int,input().split(" "))
P = list(map(int,input().split(" ")))

one,two,three = 0,0,0
for i in range(N):
    if P[i] <= A:
        one += 1
    elif P[i] > A and P[i] <= B:
        two += 1
    else:
        three += 1


print(min([one,two,three]))

Solution (Python):
N = input()
A,B = map(int, raw_input().split())
P = map(int, raw_input().split())
a,b,c = 0,0,0
for p in P:
  if p<=A:
    a += 1
  elif p<=B:
    b += 1
  else:
    c += 1
print min(a, b, c)

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
one = 0
two = 0
three = 0
for i in range(N):
    if P[i] <= A:
        one += 1
    elif P[i] <= B:
        two += 1
    else:
        three += 1
print(min(one, two, three))

Solution (Python):
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))

Solution (Python):

def main():
    buf = input()
    N = int(buf)
    buf = input()
    buflist = buf.split()
    A = int(buflist[0])
    B = int(buflist[1])
    buf = input()
    buflist = buf.split()
    P = list(map(int, buflist))
    group_count = [0, 0, 0]
    for i, score in enumerate(P):
        if score <= A:
            group_count[0] += 1
        elif score <= B:
            group_count[1] += 1
        else:
            group_count[2] += 1
    print(min(group_count))

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a, b = map(int, input().split())
point = list(map(int, input().split()))

q = [0, 0, 0]
for p in point:
  if p <= a:
    q[0] += 1
  elif p <= b:
    q[1] += 1
  else:
    q[2] += 1

print(min(q))

Solution (Python):

"""
This file is part of https://github.com/Cheran-Senthil/PyRival.

Copyright 2018 Cheran Senthilkumar all rights reserved,
Cheran Senthilkumar <hello@cheran.io>
Permission to use, modify, and distribute this software is given under the
terms of the MIT License.

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op

import sys
from atexit import register
from bisect import bisect_left, bisect_right







if sys.version_info[0] < 3:
    
    from io import BytesIO as stream
    
else:
    
    from io import StringIO as stream
    
    


if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip


def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))


def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x


def main():
    n = int(input())
    a, b = map(int, input().split(' '))
    p = list(map(int, input().split(' ')))

    part1 = len(list(filter(lambda x: x <= a, p)))
    part2 = len(list(filter(lambda x: a + 1 <= x <= b, p)))
    part3 = len(list(filter(lambda x: b + 1 <= x, p)))

    print(min(part1, part2, part3))


if __name__ == '__main__':
    sync_with_stdio(False)
    main()

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


cnt = [0, 0, 0]

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

print(min(cnt))

Solution (Python):
n = int(input())
a, b = list(map(int, input().split()))
plist = list(map(int, input().split()))
f = 0
m = 0
l = 0
for p in plist:
    if p <= a:
        f += 1
    elif a < p <= b:
        m += 1
    else:
        l += 1
print(min(f, min(m, l)))

Solution (Python):
a = int(input())
n,k= map(int,input().split())
x = list(map(int,input().split()))
aa = bb = cc = 0
for i in range(a):
    if x[i] <= n:
        aa+=1
    elif n+1 <= x[i] <= k:
        bb+=1
    else:cc+=1
print(min(aa,bb,cc))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = [int(x) for x in input().split()]
C = [0, 0, 0]
for p in P:
  if p <= A:
    C[0] += 1
  elif p <= B:
    C[1] += 1
  else:
    C[2] += 1
print(min(C))

Solution (Python):
N = int(input())

A, B = map(int, input().split())

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

k1 = 0
k2 = 0
k3 = 0

for i in range(N):
    if P[i]<=A:
        k1 = k1+1
    elif P[i]<=B:
        k2 = k2+1
    else:
        k3 = k3+1
      
ans = [k1, k2, k3]    
    
print(min(ans))

Solution (Python):
N=int(input())

A,B=map(int,input().split())
P=list(map(int,input().split()))
one=0
two=0
three=0

for i in range(N):
  if P[i]<=A:
    one+=1
  elif P[i]>B:
    three+=1
  else:
    two+=1

print(min(one,two,three))

Solution (Python):
import numpy as np

n = int(input())
a,b = list(map(int, input().split()))
p = list(map(int, input().split()))
p = np.array(p)
try:
    print(np.min([np.sum(p <= a), np.sum((a < p) * (p <= b)), np.sum((b < p))]))
except:
    print(0)

Solution (Python):
n = int(input())
a, b = map(int, input().split(' '))
x, y, z = 0, 0, 0
p = list(map(int, input().split(' ')))
for i in range(n):
    if p[i] <= a:
        x += 1
    elif p[i] <= b:
        y += 1
    else:
        z += 1
ans = min(x, y, z)
print(ans)

Solution (Python):
n = int(input())
A, B = map(int, input().split())
p = list(map(int, input().split()))

a = 0
b = 0
c = 0

for x in p:
    if x <= A:
        a += 1
    elif x <= B:
        b += 1
    else:
        c += 1

print(min(a, b, c))

Solution (Python):
n = int(input())
a,b = map(int,input().split())
x = 0
y = 0
z = 0
P = list(map(int,input().split()))

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

print(min(x,y,z))

Solution (Python):
N = int(input())
A, B = [int(a) for a in input().split()]
p_list = [int(a) for a in input().split()]

p_list1 = [a for a in p_list if a <= A]
p_list2 = [a for a in p_list if A < a <= B]
print(str(min([len(p_list1), len(p_list2),N - len(p_list1) - len(p_list2)])))

Solution (Python):
N = int(input())
A, B = list(map(int, input().split()))
P = list(map(int, input().split()))

x, y, z = 0, 0, 0
for i in range(N):
	if P[i] <= A:
		x += 1
	elif P[i] <= B:
		y += 1
	else:
		z += 1

print(min(x, y, z))

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

n1, n2, n3 = 0, 0, 0
for pp in p:
    if pp <= a:
        n1 += 1
    elif pp <= b:
        n2 += 1
    else:
        n3 += 1
print(min(n1, n2, n3))

Solution (Python):
n = input()
ab = [int(i) for i in input().split()]
a = ab[0]
b = ab[1]
p = [int(i) for i in input().split()]

num1,num2,num3 = 0,0,0
for num in p:
    if num <= a:
        num1 += 1
    elif num <= b:
        num2 += 1
    else:
        num3 += 1
print(min(num1,num2,num3))

Solution (Python):
N=int(input())
A,B=map(int,input().split())
P=list(map(int,input().split()))
a=0
b=0
c=0
for p in P:
    if p<=A: a+=1
    elif p<=B: b+=1
    else: c+=1
print(min([a,b,c]))

Solution (Python):
n = input()
a,b = map(int, raw_input().split())
l = map(int, raw_input().split())
cnt1 = 0
cnt2 = 0
cnt3 = 0
for x in l:
	if x <= a:
		cnt1 += 1
	elif x >= b+1:
		cnt3 += 1
	else:
		cnt2 += 1
print min(cnt1, cnt2, cnt3)

Solution (Python):
n = int(input())
a, b = [int(_) for _ in input().split()]
p = [int(_) for _ in input().split()]

first = 0
second = 0
third = 0
for pi in p:
    if pi <= a:
        first += 1
    elif pi <= b:
        second += 1
    else:
        third += 1

print(min(first, second, third))

Solution (Python):



def solve(a, b, ps):
    easy = mid = hard = 0
    for p in ps:
        if p <= a:
            easy += 1
        elif a + 1 <= p <= b:
            mid += 1
        else:
            hard += 1
    return min(easy, mid, hard)


def main():
    _ = int(input())
    a, b = (int(z) for z in input().split())
    ps = [int(z) for z in input().split()]
    res = solve(a, b, ps)
    print(res)


if __name__ == "__main__":
    main()

Solution (Python):
def inpl(): return [int(i) for i in input().split()]

N = int(input())
A, B = inpl()
P = inpl()

ctr1, ctr2, ctr3 = 0, 0, 0

for i in P:
    if i <= A:
        ctr1 += 1
    elif i <= B:
        ctr2 += 1
    else:
        ctr3 += 1
print(min(ctr1, ctr2, ctr3))

Solution (Python):
def aising2019_b():
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))
    first = second = third = 0
    for v in p:
        if v <= a:
            first += 1
        elif v <= b:
            second += 1
        else:
            third += 1
    print(min([first, second, third]))


aising2019_b()

Solution (Python):
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

n = getN()
a, b = getMN()
points = getlist()

x ,y, z = 0,0,0
for p in points:
    if p <= a:
        x += 1
    if a < p <= b:
        y += 1
    if p > b:
        z += 1

print(min([x,y,z]))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
L = [0] * 3
for p in P:
    if p<=A:
        L[0] += 1
    elif p<=B:
        L[1] += 1
    else:
        L[2] += 1
print(min(L))

Solution (Python):
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))

Solution (Python):

N = int(input())

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


ans = 0

count1 = 0
count2 = 0
count3 = 0

for p in P:
    if p<= A:
        count1 += 1
    elif p<=B:
        count2 += 1
    else:
        count3 += 1



print(min(count1,count3,count2))

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

Solution (Python):
n = int(input())
a, b = map(int, input().split())
p = 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))

Solution (Python):





N = int(input())
A, B = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

a = b = c = 0
for p in P:
    if p <= A:
        a += 1
    elif p <= B:
        b += 1
    else:
        c += 1

print(min(a, b, c))

Solution (Python):

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

na = 0
nb = 0
nc = 0
for p in pl:
    if p<=a:
        na += 1
    elif a+1<=p<=b:
        nb += 1
    else:
        nc += 1

print(min(na,nb,nc))

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

c1 = 0
c2 = 0
c3 = 0

for num in p:
    if num <= a:
        c1 += 1
    elif num <= b:
        c2 += 1
    else:
        c3 += 1

print(min(c1, c2, c3))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
p_list = tuple(map(int, input().split()))

first = []
second = []
third = []
for p in p_list:
    if p <= A:
        first.append(p)
    elif p <= B:
        second.append(p)
    else:
        third.append(p)

print(min(len(first), len(second), len(third)))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
Ps = list(map(int, input().split()))

nums = [0] * 3
for P in Ps:
    if P <= A:
        i = 0
    elif P <= B:
        i = 1
    else:
        i = 2
    nums[i] += 1

print(min(nums))

Solution (Python):
N = int(input())
A, B = map(int, input().split())

a = list(map(int, input().split()))
first = 0
second = 0
third = 0

for x in a:
  if x <= A:
    first += 1
  elif x > B:
    third += 1
  else:
    second += 1

print(min(first, second, third))

Solution (Python):

N = int(input())
A, B = map(int, input().split())
P_list = list(map(int, input().split()))
c1 = 0
c2 = 0
c3 = 0

for p in P_list:
    if p <= A:
        c1 +=1
    elif p <= B:
        c2 += 1
    else:
        c3 += 1
        
print(min(c1, c2, c3))

Solution (Python):
N=int(input())
a,b=map(int,input().split())
P=[int(i) for i in input().split()]
x=0
y=0
z=0
for p in P:
    if p<=a:
        x+=1
    elif a+1<=p<=b:
        y+=1
    elif b+1<=p:
        z+=1
print(min(x,y,z))

Solution (Python):

def inpl(): return list(map(int, input().split()))
N = int(input())
A, B = inpl()
P = inpl()

a, b, c = 0, 0, 0
for p in P:
    if p <= A:
        a += 1
    elif A < p <= B:
        b += 1
    else:
        c += 1
print(min(a, b, c))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
*P, = map(int, input().split())
C = [0]*3
for p in P:
    if p <= A:
        C[0] += 1
    elif p <= B:
        C[1] += 1
    else:
        C[2] += 1
print(min(C))

Solution (Python):



II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N = II()
    A, B = MI()
    c = [0, 0, 0]
    for p in MI():
        if p <= A: c[0] += 1
        elif p <= B: c[1] += 1
        else: c[2] += 1
    return min(c)


if __name__ == "__main__":
    print(main())

Solution (Python):
N=int(input())
A,B=map(int,input().split())
P=list(map(int,input().split()))

PA=len([P[i] for i in range(N) if P[i]<=A])
PB=len([P[i] for i in range(N) if P[i]>B])
PC=N-PA-PB

print(min(PA,PB,PC))

Solution (Python):
def rank(n):
    if n <= A:
        return 0
    elif n <= B:
        return 1
    else:
        return 2


n = int(input())
A, B = map(int, input().split())
ans = [0, 0, 0]
for i in map(int, input().split()):
    ans[rank(i)] += 1
print(min(ans))

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

one, two, three = 0, 0, 0
for i in p:
	if i <= a:
		one += 1
	elif a < i <= b:
		two += 1
	else:
		three += 1
print(min(one, two, three))

Solution (Python):



n = int(input())
a,b = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]

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

print(min(k))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))

p1 = p2 = p3 = 0
for p in P:
  if p <= A:
    p1 += 1
  elif p <= B:
    p2 += 1
  else:
    p3 += 1
print(min(p1, p2, p3))

Solution (Python):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
a = 0
b = 0
c = 0
for i in range(N):
    if P[i] <= A:
        a+=1
    elif P[i] <= B:
        b+=1
    else:
        c+=1
print(min(a,b,c))

Solution (Python):
def A():
    N = int(input())
    H = int(input())
    W = int(input())
    print((N - H + 1) *(1 + N - W))


def B():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, input().split()))
    f = []
    s = []
    t = []
    for i in P:
        if i <= A:
            f.append(i)
        elif i <= B:
            s.append(i)
        else:
            t.append(i)
    print(min(len(f), len(s), len(t)))
B()

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = [int(p) for p in input().split()]
Problem = [0, 0, 0]
for p in P:
    if p <= A: Problem[0] += 1
    elif A < p <= B: Problem[1] += 1
    else: Problem[2] += 1
print(min(Problem))

Solution (Python):
import sys
input = sys.stdin.readline

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

c1 = 0
c2 = 0
c3 = 0

for i in range(n):
    if p[i] <= a:
        c1 += 1
    elif (a+1 <= p[i]) and (p[i] <= b):
        c2 += 1
    else:
        c3 += 1

print(min(c1, c2, c3))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))

c1, c2, c3 = 0,0,0
for p in P:
  if p <= A:
    c1 += 1
  elif p <= B:
    c2 += 1
  else:
    c3 += 1

print(min(c1,c2,c3))

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

ans = [0,0,0]
for i in range(n):
    if p[i] <= a:
        ans[0]+= 1
    elif p[i]<=b:
        ans[1]+=1
    else:
        ans[2] += 1
print(min(ans))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
dic = [0] * 3
for i in range(N):
    if P[i] <= A:
        dic[0] += 1
    elif P[i] <= B:
        dic[1] += 1
    else:
        dic[2] += 1

print(min(dic))

Solution (Python):
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))

Solution (Python):
N = int(input())
A,B = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]

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

Solution (Python):
n = int(input())
a, b = map(int, input().split())
f = [0, 0, 0]
for x in map(int, input().split()):
    if x <= a:
        f[0] += 1
    elif x <= b:
        f[1] += 1
    else:
        f[2] += 1
print(min(f))

Solution (Python):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))

ans1,ans2,ans3 = 0,0,0
for i in range(N):
    if P[i]<=A:
        ans1 += 1
    elif P[i]<=B:
        ans2 += 1
    else:
        ans3 += 1

print(min(ans1,ans2,ans3))

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

N = int(input())
A, B = map(int, input().split())
Ps = list(map(int, input().split()))

c1 = 0
c2 = 0
c3 = 0
for p in Ps:
    if p <= A: c1 += 1
    elif p <= B: c2 += 1
    else: c3 += 1
print(min(c1, c2, c3))

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a,b = li()
p = list(li())

one = 0
two = 0
thr = 0
for pi in p:
    if pi <= a:
        one += 1
        
    elif pi <= b:
        two += 1
        
    else:
        thr += 1
        
print(min(one,two,thr))

Solution (Python):
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))

Solution (Python):
N = int(input())
A, B = map(int, input().split())

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

X = [0] * 3
for p in P:
    if p <= A:
        X[0] += 1
    elif p <= B:
        X[1] += 1
    else:
        X[2] += 1
print(min(X))

Solution (Python):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))

a = b = c = 0
for p in P:
    if p <= A:
        a += 1
    elif p <= B:
        b += 1
    else:
        c += 1
print(min(a,b,c))

Solution (Python):
N = input()
A, B = map(int, raw_input().split())
P = map(int, raw_input().split())
cnt = [0, 0, 0]

for p in P:
    if p <= A:
        cnt[0] += 1
    elif p >= B + 1:
        cnt[2] += 1
    else:
        cnt[1] += 1

print min(cnt)

Solution (Python):
n = int(input())
a,b = map(int, input().split())
c = list(map(int, input().split()))
d = 0
e = 0
f = 0
for i in c:
  if i <= a:
    d += 1
  elif i > b:
    f += 1
  else:
    e += 1
print(min(min(d,e),f))

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