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):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    a,b=map(int,input().split())
    P=[int(_) for _ in input().split()]
    P.sort()
    cunt1,cunt2,cunt3=0,0,0
    for p in P:
        if p<=a:
            cunt1+=1
        elif a+1<=p and p<=b:
            cunt2+=1
        else:cunt3+=1
    print(min(cunt1,cunt2,cunt3))

if __name__=='__main__':
    main()

Solution (Python):

import re
import math
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
week=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod_,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod_-2,mod_)*pow(fac[r],mod_-2,mod_))%mod_
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)


import re
import math
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)

def main():
    n=int(input())
    A,B=map(int,input().split())
    P=list(map(int,input().split()))
    C=[0,0,0]
    for a in P:
      if a<=A:
        C[0]+=1
      elif A+1<=a and a<=B:
        C[1]+=1
      else:
        C[2]+=1

    print(min(C))

main()

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

Solution (Python):
from bisect import *
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
P.sort()
a = bisect_right(P, A)
b = bisect_right(P, B)-a
c = N-b-a
print(min(a, b, c))

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

c1 = 0
c2 = 0
c3 = 0

for pi in p:
    if pi <= a:
        c1 += 1
    elif pi <= 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()))

first = 0
second = 0
third = 0
ans = []

for i in range(len(p)):
  if p[i] <= a:
    first += 1
  elif p[i] >= a+1 and p[i] <= b:
    second += 1
  elif p[i] >= b+1:
    third += 1

ans.append(first)
ans.append(second)
ans.append(third)

print(min(ans))

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

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

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

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

cnt_a = 0
cnt_b = 0
for p in Ps:
    if p <= A:
        cnt_a += 1
    elif p > B:
        cnt_b += 1
print(min(cnt_a,cnt_b,N-cnt_a-cnt_b))

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

x,y,z = 0,0,0
for i in p:
    if i <= a:
        x += 1
    elif a + 1 <= i <= b:
        y += 1
    else:
        z += 1


print(min(x,y,z))

Solution (Python):
import bisect
n = int(input())
a,b = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
x = bisect.bisect_right(P, a)
y = bisect.bisect_right(P, b)
print(min(x, y-x, n-y))

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
a,b = iim()
P = iil()

p1 = []
p2 = []
p3 = []

for item in P:
    if item <= a:
        p1.append(item)
    elif item <= b:
        p2.append(item)
    else:
        p3.append(item)
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()))
first = [p for p in P if p<=A]
second = [p for p in P if p>A and p<=B]
third = [p for p in P if p>B]

ans = min(len(first),len(second),len(third))

print(ans)

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

Solution (Python):
import sys
from collections import defaultdict

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()
A, B = MI()
P = LMI()

d = defaultdict(int)
for p in P:
    if p <= A:
        d[0] += 1
    elif A < p <= B:
        d[1] += 1
    else:
        d[2] += 1
print(min(d[0], d[1], d[2]))

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 A < p <= B]
P3 = [p for p in P if B < p]
print(min(len(P1), len(P2), len(P3)))

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a = b = c = 0
n = int(input())
A,B = map(int,input().split())
P = list(map(int,input().split()))
for i,pi in enumerate(P):
    if pi <= A:
        a += 1
    elif A+1 <= pi <= 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()))
P1 = [p for p in P if p <= A]
P2 = [p for p in P if A < p <= B]
P3 = [p for p in P if B < p]

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()))
q=[0,0,0]
for x in p:
    if x<=a: q[0]+=1
    elif x>a and x<=b: q[1]+=1
    else: q[2]+=1

print(min(q))

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

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

print(min(pr))

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

cnt1, cnt2, cnt3 = 0, 0, 0
for i in range(N):
    if P[i] <= A:
        cnt1 += 1
    elif A < P[i] <= B:
        cnt2 += 1
    else:
        cnt3 += 1
print(min(cnt1, cnt2, cnt3))

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

B = [0, 0, 0]

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

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

Solution (Python):
N = int(input())
A,B = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]
am = 0
ab = 0
bu = 0
for i in range(N):
    if P[i]<=A:
        am+=1
    if A+1<=P[i]<=B:
        ab +=1
    if B+1<=P[i]:
        bu+=1

print(min(am,ab,bu))

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

l = [0,0,0]
for i in range(N):
    if (P[i] <= A):
        l[0] += 1
    elif (P[i] <= 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()))

nums = [0] * 3
for e in p:
    if e <= a:
        nums[0] += 1
    elif e <= b:
        nums[1] += 1
    else:
        nums[2] += 1

ans = min(nums)
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
n = int(input())
a, b = map(int,input().split())
P = list(map(int,input().split()))

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

Solution (Python):
def main():
    questions = int(input())
    a, b = map(int, input().split())
    score = list(map(int, input().split()))
    count_range = [0, 0, 0]
    for s in score:
        if s <= a:
            count_range[0] += 1
        elif s <= b:
            count_range[1] += 1
        else:
            count_range[2] += 1
    print(min(count_range))


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
li1 = [i for i in p if i<=a]
li2 = [i for i in p if a<i<=b]
li3 = [i for i in p if b<i]
a,b,c=len(li1),len(li2),len(li3)
print(min(a,b,c))

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


if __name__ == '__main__':
    main()

Solution (Python):



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


combi_1 = []
combi_2 = []
combi_3 = []


for p in P_list:
    if p<=A:
        combi_1.append(p)
    elif p>=(A+1) and p<=B:
        combi_2.append(p)
    else:
        combi_3.append(p)


ans = min(len(combi_1), len(combi_2), len(combi_3))
print(ans)

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

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

import bisect
abis = bisect.bisect_right(p,a)
bbis = bisect.bisect_right(p,b)
print(min(abis-0, bbis-abis, len(p)-bbis))

Solution (Python):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
one = sum(1 for i in p if i <= a)
two = sum(1 for i in p if a + 1 <= i <= b)
three = sum(1 for i in p if b + 1<= i)
print(min(one, two, three))

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
    elif  b + 1 <= p[i]:
        z += 1


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:
        y += 1
    else:
        z += 1
print(min(x, y, z))

Solution (Python):
def main():
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))
    cnt = [0]*3
    for v in p:
        if v <= a:
            cnt[0] += 1
        elif v <= b:
            cnt[1] += 1
        else:
            cnt[2] += 1
    print(min(cnt))

if __name__ == "__main__":
    main()

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

first = 0
second = 0
third = 0

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

print(min(first, second, third))

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

c = [0] * 3
for Pi in P:
    if Pi <= A:
        c[0] += 1
    elif Pi <= 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()))
l=[0,0,0]

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

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

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

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

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

Solution (Python):
n = int(input())
a, b = map(int, input().split())
counts = [0] * 3
for q in map(int, input().split()):
  if q <= a:
    counts[0] += 1
  elif a + 1 <= q <= b:
    counts[1] += 1
  else:
    counts[2] += 1

print(min(counts))

Solution (Python):
N,A,B,*P=map(int, open(0).read().split())
S=[0]*3
f=lambda p:(A+1<=p)+(B+1<=p)
for p in P:
    S[f(p)]+=1
print(min(S))

Solution (Python):
n = int(input())
a,b = map(int, input().split())
dat = list(map(int, input().split()))
q1=q2=q3=0
for i in range(n):
    if dat[i] <= a:
        q1 += 1
    elif a < dat[i] <= b:
        q2 += 1
    else:
        q3 += 1
print(min(q1,q2,q3))

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

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

Solution (Python):


n = int(input())
a, b = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]
p1 = [x for x in p if x <= a]
p2 = [x for x in p if a < x <= b]
p3 = [x for x in p if b < x]
r = [len(p1), len(p2), len(p3)]
print(min(r))

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

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

Solution (Python):
n = int(input())
a, b = map(int, input().split())
li = list(map(int, input().split()))
li.sort()
x = len([i for i in li if i <= a])
y = len([i for i in li if a < i <= b])
z = len([i for i in li if b < i])
print(min(x, y, z))

Solution (Python):
n=int(input())
a,b=map(int,input().split())
l=list(map(int,input().split()))
x,y=sum(i<=a for i in l),sum(b<i for i in l)
print(min(x,y,len(l)-x-y))

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

problem_set = [0] * 3

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

print(min(problem_set))

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

p1 = []
p2 = []
p3 = []

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

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

Solution (Python):
import sys

read = sys.stdin.read

N, A, B, *P = map(int, read().split())

a = 0
b = 0
c = 0
for i in P:
    if i <= A:
        a += 1
    elif A < i <= 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()))
cnt = 0
e,m,h = 0,0,0
for i in range(N):
	if P[i] <= A:
		e+=1
	elif P[i] <= B:
		m+=1
	else:
		h+=1
ans = min(min(e,m),h)
print(ans)

Solution (Python):
def main(n, a, b, p):
    _a, _ab, _b = 0, 0, 0

    for p in p:
        if p <= a:
            _a += 1
        elif a < p <= b:
            _ab += 1
        elif p > b:
            _b += 1

    print(min(_a, _ab, _b))


if __name__ == "__main__":
    n = int(input())
    a, b = map(int, input().split())
    p = list(map(int, input().split()))

    main(n, a, b, p)

Solution (Python):
number=int(input().rstrip())
A,B=input().rstrip().split()
score=input().rstrip().split()
score=list(map(int,score))

score.append(int(A)+1)
score.append(int(B)+1)
score.sort()
n1=score.index(int(A)+1)
n2=score.index(int(B)+1)-score.index(int(A)+1)-1
n3=number-score.index(int(B)+1)+1




print(min(n1,n2,n3))

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

lis = [0,0,0]

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

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

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

Solution (Python):
n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))
one=[i for i in p if i<=a]
two=[i for i in p if a<i<=b]
three=[i for i in p if i>b]
print(min(len(one),len(two),len(three)))

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
a,b = [int(x) for x in stdin.readline().rstrip().split()]
li = list(map(int,stdin.readline().rstrip().split()))

one = 0
two = 0
three = 0

for i in li:
    if i <= a:
        one += 1
    elif a+1 <= 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()))
q = [0,0,0]
for i in p:
  if i <= a:
    q[0] += 1
  elif b < i:
    q[2] += 1
  else:
    q[1] += 1
q.sort()
print(q[0])

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

Solution (Python):
n=int(input())
a,b=map(int,input().split())
x=list(map(int,input().split()))
t=0
u=0
v=0
for i in x:
  if i<=a:
    t+=1
  elif i<=b:
    u+=1
  else:
    v+=1
print(min(t,u,v))

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

first = 0
second = 0
third = 0

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

print(min(first, second, third))

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

cnt1 = 0
cnt2 = 0
cnt3 = 0

for i in range(n):
    if ls[i] <= a:
        cnt1 += 1
    elif a + 1 <= ls[i] <= b:
        cnt2 += 1
    elif ls[i] >= b + 1:
        cnt3 += 1

print(min(cnt1, cnt2, cnt3))

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

Solution (Python):
import bisect
N = int(input())
A,B = map(int, input().split())
P = list(map(int, input().split()))
P.sort()
ans = N
id = bisect.bisect_right(P,A)
ans = min(ans,id)
prev = id
id = bisect.bisect_right(P,B)
ans = min(ans,id - prev)
ans = min(ans,N - id)
print(ans)

Solution (Python):
import sys

n = int(input())
a, b = map(int, input().split())
p = sorted(list(map(int, input().split())))
cnt_1, cnt_2, cnt_3 = 0,0,0
for i in range(n):
	if p[i] > a:
		break
	cnt_1 += 1

for j in range(i,n):
	if p[j] > b:
		break
	cnt_2 += 1

	if j == n-1:
		print(0)
		sys.exit()

cnt_3 = n-j
print(min(cnt_1,cnt_2,cnt_3))

Solution (Python):
import sys
if sys.platform =='ios':
	sys.stdin=open('input.txt')
	
n = int(input())

a,b = map(int,input().split())

l = list(map(int,input().split()))
k = [0]*3

for i in range(n):
	if l[i]<=a:
		k[0]=k[0]+1
	elif a<l[i]<=b:
		k[1]=k[1]+1
	elif b<l[i]:
		k[2]=k[2]+1

print(min(k))

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

p1=[i for i in P if i <= A]
p2=[i for i in P if A+1<= i <=B]
p3=[i for i in P if i >= B+1]

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

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

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

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

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

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
import sys
for i in range(N):
    for l in range(N-3*i):
        if P[l] <= A:
            del P[l]
            break
        elif l == N-3*i-1:
            print(i)
            sys.exit()
    for l in range(N-3*i-1):
        if A < P[l] <= B:
            del P[l]
            break
        elif l == N-3*i-2:
            print(i)
            sys.exit()
    for l in range(N-3*i-2):
        if B < P[l]:
            del P[l]
            break
        elif l == N-3*i-3:
            print(i)
            sys.exit()
    if not P:
        print(i+1)
        sys.exit()

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

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

under=0
middle=0
upper=0

for i in li:
    if i<=a:
        under+=1
    elif a+1 <=i <= b:
        middle+=1
    else:
        upper+=1
print(min(under,middle,upper))

Solution (Python):
n,a,b,*p=map(int,open(0).read().split())
x=y=z=0
for q in p:
  if q<=a:
    x+=1
  elif a<q<=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()))
one = 0
two = 0
three = 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
ans = min(one,two)
ans = min(ans,three)
print(ans)

Solution (Python):

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

Solution (Python):
def examB():
    N = I(); A,B = LI()
    P = LI()
    exam = [0]*3
    for i in P:
        if i<=A:
            exam[0] +=1
        elif i<=B:
            exam[1] +=1
        else:
            exam[2] +=1
    ans = min(exam)
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

Solution (Python):


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

f,s,t=0,0,0
for e in p:
    if e<=a:f+=1
    elif b+1<=e:t+=1
    else:s+=1
print(min(f,s,t))

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

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

q1,q2,q3=0,0,0

for i in range(n):
    if p[i]<=a:
        q1+=1
    elif p[i]<=b:
        q2+=1
    else:
        q3+=1

print(min([q1,q2,q3]))