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())
l=list(map(int,input().split()))
x,y,z=0,0,0
for i in l:
  if(i<=a):
    x+=1
  elif(i>a and i<=b):
    y+=1
  elif(i>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()))

cnta=0
cntm=0
cntb=0

for i in range(n):
  if p[i]<=a:
    cnta+=1
  elif (p[i]>=a+1) and (p[i]<=b):
    cntm+=1
  else:
    cntb+=1

print(min(cnta,cntm,cntb))

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

x = [a for a in P if a <= A]
y = [a for a in P if (a > A)and(a <= B)]
z = [a for a in P if (a > B)]

r = min(len(x), len(y), len(z))

print(r)

Solution (Python):
N = input()
A,B = list(map(int,input().split()))
P = list(map(int,input().split()))
c1 = [1 if x<=A else 0 for x in P]
c2 = [1 if (x>A and x<=B) else 0 for x in P]
c3 =[1 if x>B else 0 for x in P]
c1 = sum(c1)
c2 = sum(c2)
c3 = sum(c3)
print(min([c1,c2,c3]))

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

t = [[] for _ in range(3)]

for i in p:
    if i <= a:
        t[0].append(i)
    elif i <= b:
        t[1].append(i)
    else:
        t[2].append(i)

print(min(len(t[0]), len(t[1]), len(t[2])))

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

for i in range(n):
  if p[i]<=a:
    a_cnt+=1
  elif p[i]>=a+1 and b>=p[i]:
    b_cnt+=1
  elif p[i]>=b+1:
    c_cnt+=1

print(min(a_cnt, b_cnt, c_cnt))

Solution (Python):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
s=[]
c=0
d=0
e=0
for i in p:
  if i<=a:
    c+=1
  elif a+1<=i<=b:
    d+=1
  elif b+1<=i:
    e+=1
s.append(c)
s.append(d)
s.append(e)
print(min(s))

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

one = []
two = []
three = []

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

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

Solution (Python):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
x1,x2,x3 = 0,0,0
for i in range(N):
    if P[i]<=A:
        x1 += 1
    if P[i]>=A+1 and P[i]<=B:
        x2 += 1
    if P[i]>= B+1:
        x3 += 1
print(min(x1,x2,x3))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = [int(s) for s 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):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a: print("AC")
    else :print("WA")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

l = ip()                              
a,b= (int(i) for i in input().split())      


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


sorted(x)
c = []
d = []
e = []
for i in range(len(x)):
    if x[i] <= a:
        c.append(x[i])
    elif a < x[i] and x[i] <=b:
        d.append(x[i])
    else:
        e.append(x[i])
f = len(c)
g = len(d)
i = len(e)

print(min(f,g,i))

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

num1 = 0
num2 = 0

for p in ps:
    if p <= a:
        num1 += 1
    elif p <= b:
        num2 += 1
num3 = n - num1 - num2
print(min([num1, num2, num3]))

Solution (Python):
n = int(input())
a, b = map(int, input().split())
P = list(map(int, input().split()))
P.sort()
x= 0
y = 0
z = 0
for p in P:
    if p <= a:
        x += 1
    if a+1 <= p <= b:
        y += 1
    elif b+1 <= p:
        z += 1
res = min(x, y, z)
print(res)

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

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

a = sum(i<=A for i in P)
b = sum(A<i<=B for i in P)

print(min(a, b, N-a-b))

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

x = len([i for i in p if i <= a])
y = len([i for i in p if a < i <= b])
z = len([i for i in p if b < i])

print(min(x,y,z))

Solution (Python):
N=int(input())
A,B=list(map(int,input().split()))
P=list(map(int,input().split()))
listA=[]
listB=[]
listC=[]
for i in range(N):
    if P[i] <=A:
        listA.append(P[i])
    elif P[i]<=B:
        listB.append(P[i])
    else:
        listC.append(P[i])
print(min(len(listA),len(listB),len(listC)))

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

x1 = []
x2 = []
x3 = []
for i in range(n):
  if x[i] <=a:
    x1.append(x[i])
  elif a+1 <= x[i] <= b:
    x2.append(x[i])
  else:
    x3.append(x[i])
print(min(len(x1), len(x2), len(x3)))

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

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

Solution (Python):
n = int(input())
a, b = map(int, input().split())
p_array = [int(x) for x in input().split()]
ans = 0
res = True
while res:
    if len(p_array) < 3:
        break
    for i in sorted(p_array):
        if a >= i:
            p_array.remove(i)
            break
    else:
        res = False

    for j in p_array:
        if a+1 <= j <= b:
            p_array.remove(j)
            break
    else:
        res = False


    for k in p_array:
        if b+1 <= k:
            p_array.remove(k)
            break
    else:
        res = False

    if res:
        ans += 1
print(ans)

Solution (Python):
n = map(int, input().split())
a, b = map(int, input().split())
p = sorted(list(map(int, input().split())))
ans1 = sum(map(lambda x: (1 if x <= a else 0), p))
ans2 = sum(map(lambda x: (1 if a+1 <= x <= b else 0), p))
ans3 = sum(map(lambda x: (1 if b+1 <= x else 0), p))
print(min(ans1, ans2, ans3))

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
N = int(input())
A, B = map(int,input().split())
P = [int(x) for x in input().split()]
ans = 0
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(raw_input(''))
a,b=raw_input('').split()
a=int(a)
b=int(b)
p=map(int,raw_input('').split())
ac=0
bc=0
cc=0

for i in p:
    if i<=a:
        ac+=1
    elif i>=a+1 and i<=b:
        bc+=1
    elif i>=b+1:
        cc+=1

print(min(ac,min(bc,cc)))

Solution (Python):
n = int(input())
a,b = map(int, input().split())
cnta = cntb = cntc = 0
for p in map(int, input().split()):
    if p <= a:
        cnta += 1
    if a < p <= b:
        cntb += 1
    if b < p:
        cntc += 1
print(min(cnta, cntb, cntc))

Solution (Python):
n = int(raw_input())
a, b = map(int, raw_input().split())
p = sorted(map(int, raw_input().split()))

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

print min(ar)

Solution (Python):
import numpy as np

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

AA = np.sum(p <= a)
BB = np.sum(p <= b) - AA
CC = n - AA - BB

print(min(AA, BB, CC))

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

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

P.sort()

a=[]
b=[]
c=[]
for i in range(N):
    if P[i]<=A:
        a.append(P[i])
    elif P[i]<=B:
        b.append(P[i])
    else:
        c.append(P[i])
print(min(len(a),len(b),len(c)))

Solution (Python):
import bisect

n=int(input())
a,b=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
index1=bisect.bisect_right(l,a)
index2=bisect.bisect_right(l,b)
print(min(index2-index1,index1,n-index2))

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

p1 = sum([x <= A for x in P])
p2 = sum([A+1 <= x <= B for x in P])
p3 = sum([B+1 <= x for x in P])

print(min(p1,p2,p3))

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

s = []
t = []
u = []

for i in p:
    if i <= a:
        s.append(i)
    elif b+1 <= i:
        u.append(i)
    else:
        t.append(i)

print(min(len(s),len(t),len(u)))

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

und_A = len(list(filter(lambda x:  x <= A, Ps)))
A2B =  len(list(filter(lambda x: A < x <= B, Ps)))
overB =  len(list(filter(lambda x: B < x, Ps)))

print(min(und_A,A2B,overB))

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

ans = []
e = f = g = 0

for i in p:
    if i <= a:
        e += 1
    elif i >= a and i <= b:
        f += 1
    else:
        g += 1
ans.append(e)
ans.append(f)
ans.append(g)

print(min(ans))

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

counts = [0, 0, 0]

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

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

print(min(counts))

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

num1 = 0
num2 = 0
num3 = 0
for v in P:
    if v <= A:
        num1 += 1
    elif A < v <= 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()))
p1,p2,p3=0,0,0
for pnt in P:
  if pnt <=A:
    p1+=1
  elif pnt <=B:
    p2+=1
  else:
    p3+=1
print(min([p1,p2,p3]))

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

area1=0
area2=0
area3=0
for i in range(n):
  if pList[i]<=a:
    area1+=1
  elif a+1<= pList[i]<=b:
    area2+=1
  else:
    area3+=1

ans=min(min(area1,area2),area3)
print(ans)

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P_list = list(map(int, input().split()))
P_list = sorted(P_list)
res1 = 0
res2 = 0
res3 = 0
for i in P_list:
    if i <= A:
        res1 += 1
    if A+1 <= i and i <= B:
        res2 += 1
    if B + 1 <=i:
        res3 += 1
print(min(min(res1, res2), res3))

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

ans1 = ans2 = ans3 = 0
for p in P:
    if p <= A:
        ans1 += 1
    elif A + 1 <= p <= B:
        ans2 += 1
    else:
        ans3 += 1
print(min(ans1,ans2,ans3))

Solution (Python):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
x1=[]
x2=[]
x3=[]
for i in range(n):
    if p[i]<=a:
        x1.append(p[i])
    elif a<p[i]<=b:
        x2.append(p[i])
    else:
        x3.append(p[i])
print(min(len(x1),len(x2),len(x3)))

Solution (Python):

N = int(input())
A,B = map(int,input().split())
P = list(map(int,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())
p = list(map(int, input().split()))
x = sum(x<=a for x in p)
y = sum(a<x<=b for x in p)
z = sum(x>b for x in p)
print(min(x,y,z))

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 p:
    if i <= a:
        x += 1
    elif i >= b + 1:
        z += 1
    else:
        y += 1
print(min(x, y, z))

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

ca = cb = cc = 0

for i in l:
    if i <= A :
        ca += 1
    elif A < i <= B:
        cb += 1
    elif B < i:
        cc += 1

print(min(ca,cb,cc))

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

P.sort()

a = 0
b = 0
c = 0
for pi in P:
    if pi <= A:
        a += 1
    if A < pi <= B:
        b += 1
    if B < pi:
        c += 1

print(min(a, b, c))

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

group1 = []
group2 = []
group3 = []

for p in P:
    if p <= A:
        group1.append(p)
    elif A < p and p <= B:
        group2.append(p)
    elif B < p:
        group3.append(p)

ans = min(len(group1), len(group2))
ans = min(ans, len(group3))
print(ans)

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

p0 = 0
p1 = 0
p2 = 0

for pi in P:
    if pi <= A:
        p0 += 1
    if pi > A and pi <= B:
        p1 += 1
    if pi > B:
        p2 += 1

print(min(p0, p1, p2))

Solution (Python):
N=int(input())
A,B=map(int,input().split())
P=list(map(int,input().split()))
Pa=len([p for p in P if p<=A])
Pb=len([p for p in P if p<=B])
print(min(Pa, Pb-Pa, N-Pb))

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

A=len(list(filter(lambda x:x<=a,p)))
B=len(list(filter(lambda x:a+1<=x<=b,p)))
C=len(list(filter(lambda x:x>=b+1,p)))
print(min(A,B,C))

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

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

ca = 0
cb = 0
cm = 0

for i in range(n):
    if li[i] <= a:
        ca += 1
    elif a < li[i] & li[i] <= b:
        cb += 1
    else:
        cm += 1

print(min(ca, min(cm, cb)))

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

p1,p2,p3 = [0]*3

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()))
ans = [0]*3
for i in p:
  if i <= a:
    ans[0] += 1
  elif a < i <= b:
    ans[1] += 1
  else:
    ans[2] += 1
print(min(ans))

Solution (Python):
from sys import stdin

def main():
    N = int(input())
    A, B = map(int, input().split())
    P = map(int, input().split())

    q1, q2, q3 = 0, 0, 0
    for n in P:
        if n <= A:
            q1 += 1
        elif A < n <= B:
            q2 += 1
        else:
            q3 += 1
    print(min(q1, q2, q3))

input = lambda: stdin.readline()
main()

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
	if A + 1 <= p <= B: b += 1
	if B + 1 <= p : c += 1

print(min(a, b, c))

Solution (Python):
N = input()
A, B = map(int, input().split(" "))
P = list(map(int, input().split(" ")))
num = [0, 0, 0]
for score in P:
    if score <= A:
        num[0] += 1
    elif A < score <= B:
        num[1] += 1
    elif B < score:
        num[2] += 1

print(min(num))

Solution (Python):
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
l1 = []
l2 = []
l3 = []
for e in P:
    if e <= A:
        l1.append(e)
    elif A + 1 <= e <= B:
        l2.append(e)
    elif B + 1 <= e:
        l3.append(e)
ans = min(len(l1),len(l2),len(l3))
print(ans)

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

cnt=[0 for _ in range(3)]
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):



def solve():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, 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]))


if __name__ == '__main__':
    solve()

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

P.sort()
cntA=0
cntB=0
cntC=0

for i in P:
    if i<= A:
        cntA += 1
    elif A+1<=i<=B:
        cntB += 1
    elif i>=B:
        cntC += 1

print(min(cntA,cntB,cntC))

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


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 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.sort()
a = 0
b = 0
c = 0
for tmp in p:
    if tmp <= A:
        a += 1
    elif A + 1 <= tmp <= B:
        b += 1
    else:
        c += 1

ans = min(a, b)
ans = min(ans, c)
print(ans)

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

f = 0
s = 0
t = 0

for i in range(len(P)):
    if P[i] <= A:
        f += 1
    
    elif A+1 <= P[i] <= B:
        s += 1

    elif B+1 <= P[i]:
        t += 1

print(min(f,s,t))

Solution (Python):


import sys


INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()


N = I()
A, B = LI()
P = LI()

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()))

ls_1=[]
ls_2=[]
ls_3=[]

for i in range(N):
	if P[i]<=A:
		ls_1.append(P[i])
	elif A+1<=P[i]<=B:
		ls_2.append(P[i])
	else:
		ls_3.append(P[i])

m=min(min(len(ls_1), len(ls_2)),len(ls_3))
print(m)

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

count = 3*[0]

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


print(min(count))

Solution (Python):
n = int(input())
p = input().split()
a = int(p[0])
b = int(p[1])
first = []
second = []
third = []
q = input().split()
for i in q:
    i = int(i)
    if i <= a:
        first.append(i)
    elif i <= b:
        second.append(i)
    else:
        third.append(i)
print(min([len(first), len(second), len(third)]))

Solution (Python):
import bisect
N = int(input())
A, B = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]
P.sort()
problem_first = bisect.bisect_right(P, A)
problem_second = bisect.bisect_right(P, B) - bisect.bisect_left(P, A + 1)
problem_third = N - bisect.bisect_left(P, B + 1)
ans = min([problem_first, problem_second, problem_third])
print(ans)

Solution (Python):
N=int(input())
A,B=map(int,input().split())
series = list(map(int,input().split()))
count1=0
count2=0
count3=0
for s in series:
	if s <= A:
		count1 += 1
	elif s <= B:
		count2 += 1
	else:
		count3 += 1
print(min(count1,count2,count3))

Solution (Python):

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

plis = input().split()
res = [0,0,0]
for p in plis:
    i = int(p)
    if i <= A:
        res[0] += 1
    elif A+1 <= i and i <= B:
        res[1] += 1
    else:
        res[2] += 1

print(min(res))

Solution (Python):
n = int(input())
a, b = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
p.sort()
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))

"""
if one == 0 or two == 0 or three == 0:
    print(0)
else:
    print((one-1)*(two-1)*(three-1))
    """

Solution (Python):

from itertools import accumulate
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
li = [0] * 21
for x in P:
    li[x] += 1
li = list(accumulate(li))
print(min(li[A], li[B] - li[A], li[20] - li[B]))

Solution (Python):
N = int(input())
a,b = map(int,input().split())
arr = sorted(list(map(int,input().split())))

import bisect
first = 0
second = 0
third = 0
first = bisect.bisect_right(arr,a)
second = bisect.bisect_right(arr,b) - first
third = N -second - first
print(min(first,second,third))

Solution (Python):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
p1=[]
p2=[]
p3=[]
for i in p:
    if i<=a:
        p1.append(i)
    elif i<=b:
        p2.append(i)
    else:
        p3.append(i)
print(min(len(p1),len(p2),len(p3)))

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

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

count1 = 0
count2 = 0
count3 = 0

for i in range(N):
  if P[i] <= A:
    count1 +=1
  elif A < P[i] and P[i] <= B:
    count2 +=1
  else:
    count3 +=1

print(min(count1,count2,count3))

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B, P):
    P.sort()

    p1 = 0
    p2 = 0
    p3 = 0
    for p in P:
        if p <= A:
            p1 += 1
        elif p <= B:
            p2 += 1
        else:
            p3 += 1

    return min(p1, p2, p3)


def main():
    N = read_int()
    A, B = read_int_n()
    P = read_int_n()
    print(slv(N, A, B, P))


if __name__ == '__main__':
    main()

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

P1=[p for p in P if p <=A]
P2=[p for p in P if (p >A and p<=B)]
P3=[p for p in P if (p >B)]

print(min([len(P1),len(P2),len(P3)]))

Solution (Python):
n = input()
a, b = map(int, raw_input().split())
l = map(int, raw_input().split())
lesa, bwab, gtb = 0, 0, 0
for i in l:
	if i <= a:
		lesa += 1
	elif a < i <= b:
		bwab += 1
	else:
		gtb += 1
print min(lesa, bwab, gtb)

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

P.sort()

a = [p for p in P if p <= A]
b = [p for p in P if A + 1 <= p and p <= B]
c = [p for p in P if B + 1 <= p]

print(min(len(a), len(b), len(c)))

Solution (Python):

import math


def main():
    """Function."""
    n = int(input())
    a, b = map(int, input().split())
    ps = list(map(int, input().split()))

    low, middle, large = 0, 0, 0

    for i in range(n):
        if ps[i] <= a:
            low += 1
        elif ps[i] > b:
            large += 1
        else:
            middle += 1

    print(min([low, middle, large]))



if __name__ == "__main__":
    main()

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

Solution (Python):
n = int(input())
a, b = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
f = len([i for i in p if i<=a])
s = len([i for i in p if a<i<=b])
t = len([i for i in p if b<i])
print(min(f,s,t))

Solution (Python):

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

p1_cnt = sum([1 for p in Pn if p <= A])
p2_cnt = sum([1 for p in Pn if A+1 <= p <= B])
p3_cnt = sum([1 for p in Pn if B+1 <= p])

print(min([p1_cnt, p2_cnt, p3_cnt]))

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 = map(int,input().split())
p = list(map(int, input().split()))
p.sort()
ans = [0 for _ in range(3)]
for pp in p:
    if pp <= a:
        ans[0] += 1
    elif (a < pp and pp <= 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()))
aika = bika = bijyo = 0
for i in range(n):
    if p[i] <= a:aika += 1
    elif p[i] > b:bijyo += 1
    else:bika += 1
print(min(aika,bijyo,bika))

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

cnt = [0] * 3

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

print(min(cnt))

Solution (Python):
import sys
import math
input = sys.stdin.readline
N = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
p1 = []
p2 = []
p3 = []

for i in range(N):
    if P[i] <= A:
        p1.append(P[i])
    elif A < P[i] <= B:
        p2.append(P[i])
    else:
        p3.append(P[i])

p = min(len(p1),len(p2),len(p3))
print(p)

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 P:
    if i <= a:
        c1+=1
    elif i <= b:
        c2+=1
    else:
        c3+=1
print(min(c1,c2,c3))

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

m1, m2, m3 = 0,0,0
for p in P:
    if p <= A:
        m1 += 1
    elif p <= B:
        m2 += 1
    else:
        m3 += 1
print(min(m1, m2, m3))

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

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

one = [p for p in P if p <= A]
two = [p for p in P if A < p and p <= B]
three = [p for p in P if B < p]

print(min(len(one), len(two), len(three)))

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

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

n_case1 = 0
n_case2 = 0
n_case3 = 0

for point in P:
    if point <= A:
        n_case1 += 1
    elif point <= B:
        n_case2 += 1
    else:
        n_case3 += 1

min_case = min([n_case1, n_case2, n_case3])
ans = min_case
print(ans)

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

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

first = list(filter(lambda x: x <= a, p))
second = list(filter(lambda x: x > a and x <= b, p))
third = list(filter(lambda x: x > b, p))

if first == 0 or second == 0 or third == 0:
    print(0)
    exit(0)



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

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
P1 = 0
P2 = 0
P3 = 0
for pi in P:
    if pi <= A:
        P1 += 1
    elif pi <= B:
        P2 += 1
    else:
        P3 += 1

print(min(min(P1, P2), P3))

Solution (Python):
n,a,b,*p=map(int,open(0).read().split())
c=[0]*3
for t in p:
    if t<=a:
        c[0]+=1
    elif t<=b:
        c[1]+=1
    else:
        c[2]+=1
print(min(c))

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

a = []
b = []
c = []

for i in input().split():
    item = int(i)
    if item <= A:
        a.append(item)
    elif A + 1 <= item <= B:
        b.append(item)
    elif B < item:
        c.append(item)

print(min(len(a), len(b), len(c)))

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

X, Y, Z = 0, 0, 0
for p in P:
    if p <= A:
        X += 1
    elif A + 1 <= p <= B:
        Y += 1
    elif B + 1 <= p:
        Z += 1

if X > 0 and Y > 0 and Z > 0:
    print(min(X, Y, Z))
else:
    print(0)

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

Solution (Python):
def solve(N, A, B, Ps):
    q1 = len([p for p in Ps if p <= A])
    q2 = len([p for p in Ps if A + 1 <= p <= B])
    q3 = len([p for p in Ps if B + 1 <= p])
    return min(q1, q2, q3)


if __name__ == "__main__":
    N = int(input())
    A, B = tuple(map(int, input().split(" ")))
    Ps = list(map(int, input().split(" ")))
    print(solve(N, A, B, Ps))

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