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 numpy as np
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))

P = np.array(P)
X = P[P <= A]
Y = P[(P >= (A + 1)) & (P <= B)]
Z = P[P >= (B + 1)]

print(min(len(X), len(Y), len(Z)))

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

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

a,b,c = 0,0,0

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

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(N):
    if P[i]<=A:
        a+=1
    elif P[i]<=B:
        b+=1
    else:
        c+=1
l = [a, b, c]
print(min(l))

Solution (Python):
import numpy as np

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

p = np.array(sorted(p))
n_under_a = len(p[p<=a]) 
n_under_b = len(p[p<=b])-n_under_a 
n_over_b = len(p[p>b]) 

print(min(n_under_a, min(n_under_b, n_over_b)))

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

Q1 = len([n for n in P if n <= A])
Q2 = len([n for n in P if n > A and n <=B])
Q3 = len([n for n in P if n > B])

print(min(Q1,Q2,Q3))

Solution (Python):
N=int(input())
A,B=map(int,input().split() )
P=list(map(int,input().split() ))
X1=sum( [p<=A for p in P])
X2=sum( [ (p>A and p<=B)  for p in P] )
X3=sum( [p>B  for p in P] )
print(min([X1,X2,X3]))

Solution (Python):
def main():
    """
    問題が 3問出題され、
    1問目の配点は A点以下、
    2問目の配点は A+1点以上 B点以下、
    3問目の配点は  B+1点以上である。
    """
    N = int(input())
    A, B = map(int, input().split())
    *P, = map(int, input().split())

    n_a = 0
    n_ab = 0
    n_b = 0
    for p in P:
        if p > B:
            n_b += 1
        elif A < p <= B:
            n_ab += 1
        elif p <= A:
            n_a += 1

    ans = min([n_a, n_ab, n_b])
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):



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

Solution (Python):
import numpy as np


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

min_A = P_list[P_list <= A]
min_B = P_list[(P_list > A) & (P_list <= B)]
above_B = P_list[P_list > B]

print(min(len(min_A), len(min_B), len(above_B)))

Solution (Python):
def piyo():
    _ = int(input())
    a, b = (int(_) for _ in input().split()) 
    p = list(int(i) for i in input().split())
    c1=0
    c2=0
    c3=0
    for i in p:
        if i<=a:
            c1+=1
        elif a<i and i<=b:
            c2+=1
        elif b<i:
            c3+=1
    ans=min(c1,c2,c3)
    print(ans)

if __name__ == '__main__':
    piyo()

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

count = collections.Counter(p)

nQues = []
nQues.append( sum([count[i] for i in count.keys() if i <= a]) )
nQues.append( sum([count[i] for i in count.keys() if a < i and i <= b]) )
nQues.append( sum([count[i] for i in count.keys() if b < i]) )

print(min( nQues ))

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

ans_1 = len([p for p in p_lst if p <= a])
ans_2 = len([p for p in p_lst if p >  a and p <= b])
ans_3 = len([p for p in p_lst if p > b])
print(min(ans_1,ans_2,ans_3))

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
Answer = min(First,Second,Third)
print(Answer)

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
a = sum(x <= A for x in P)
b = sum((A + 1) <= x and x <= B for x in P)
c = sum(B + 1 <= x for x in P)
print(min([a, b, c]))

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

low = len([i for i in P if i <= A])
mid = len([i for i in P if (i > A and i <= B)])
high = len([i for i in P if i > B])

num = min(low,mid,high)

print(num)

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

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=0
for i in range(N):
    if P[i]<=A:
        s+=1
    if P[i]>A and P[i] <= B:
        t+=1
    if P[i] > B:
        u+=1
re = min(s,t,u)
print(re)

Solution (Python):
N = int(input())
A,B=map(int, input().split())
hoge1=[]
hoge2=[]
hoge3=[]
hoge = [int(i) for i in input().split()]
for j in range(N):
    p=hoge[j]
    if(p<=A):
        hoge1.append(p)
    elif(B+1<=p):
        hoge3.append(p)
    else:
        hoge2.append(p)
print(min(len(hoge1),len(hoge2),len(hoge3)))

Solution (Python):


def main():
    n = int(input())
    a, b = [int(x) for x in input().split()]
    p = [int(x) for x in input().split()]
    
    q1count = len([x for x in p if x<=a])
    q2count = len([x for x in p if a+1<=x and x<=b])
    q3count = len([x for x in p if b+1<=x])

    print(min(q1count, q2count, q3count))

if __name__ == '__main__':
    main()

Solution (Python):



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

o1 = sum(1 for x in p if x<=a)
o3 = sum(1 for x in p if x>b)
o2 = n-o1-o3

print(min(o1,o2,o3))

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

Solution (Python):
import numpy as np

N=int(input())
a,b= map(int,input().split())
P = list(map(int, input().split()))



a1=[]
a2=[]
a3=[]

for i in range(0,N):
    
    if(P[i]<=a):
        a1.append(P[i])
    elif(P[i]<=b):
        a2.append(P[i])

    else:
        a3.append(P[i])

print(np.min([len(a1),len(a2),len(a3)]))

Solution (Python):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
res = [0] * 3
for item in p:
    if item <= a:
        res[0] += 1
    elif (item >= (a + 1)) and (item <= b):
        res[1] += 1
    elif item >= (b + 1):
        res[2] += 1
print(min(res))

Solution (Python):
n = int(input())
low, high = map(int, input().split())
points = list(map(int, input().split()))
c = len(list(filter(lambda p: p > high, points)))
b = len(list(filter(lambda p: low < p <= high, points)))
a = len(list(filter(lambda p: p <= low, points)))
print(min(a,b,c))

Solution (Python):
import numpy as np
N = int(input())
A,B = map(int,input().split())
point = list(map(int,input().split()))
point = np.array(point)

first = np.sum(point <= A)
third = np.sum(point >= B+1)
second = N - first - third

print(min(first,second,third))

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

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

q1 = 0
q2 = 0
q3 = 0

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

print(int(min(q1, q2, q3)))

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

first_list = list(filter(lambda x: x <= A, p_list))
second_list = list(filter(lambda x: A + 1 <= x <= B, p_list))
third_list = list(filter(lambda x: x >= B + 1, p_list))

print(min(map(len, [first_list, second_list, third_list])))

Solution (Python):

import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    input_raw = read_func().strip().split()
    [A, B] = [long(input_raw[0]), long(input_raw[1])]
    input_raw = read_func().strip().split()
    P = []
    for i in range(N):
        P.append(int(input_raw[i]))

    P.sort()

    A_Count = 0
    B_Count = 0
    C_Count = 0
    for i in range(N):
        if P[i] <= A:
            A_Count += 1
        elif A < P[i] and P[i] <= B:
            B_Count += 1
        elif B < P[i]:
            C_Count += 1
    print min(A_Count, B_Count, C_Count)


if __name__ == '__main__':
    main()

Solution (Python):

n = int(input())

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

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


first = sum( 1 if i<=a else 0 for i in x )
sec = sum( 1 if a<i and i<=b else 0 for i in x)
third = sum(1 if b<i else 0 for i in x)

ans = min([first,sec,third])
print(ans)

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

P.sort()


p1=0
p2=0
p3=0

for x in P:
	if x<=A:
		p1+=1
	elif A+1<=x<=B:

		p2+=1
	elif B+1<=x:
		p3+=1

print min(p1, p2, p3)

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 A < P[i] <= B:
        b += 1
    elif P[i] > B:
        c += 1

print(min(a, b, c))

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

easy = 0
normal = 0
hard = 0

for i in P:
    if i <= A:
        easy += 1
    elif A < i <= B:
        normal += 1
    else:
        hard += 1

print(min(easy, normal, hard))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
L1 = [1 for x in P if x <= A]
L2 = [1 for x in P if A < x <= B]
L3 = [1 for x in P if B < x]
print(min(sum(L1), sum(L2), sum(L3)))

Solution (Python):
def m():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, input().split()))
    tmp = [0] * 3
    for i in P:
        if i <= A:
            tmp[0] += 1
        elif i > A and i <= B:
            tmp[1] += 1
        elif i > B:
            tmp[2] += 1
    return min(tmp)

print(m())

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

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

s1 = []
s2 = []
s3 = []
for x in p:
    if x <= a:
        s1.append(x)
    elif x <= b:
        s2.append(x)
    else:
        s3.append(x)
print(min(len(s1), len(s2) ,len(s3)))

Solution (Python):
N = int(input())
A,B = map(int, input().split())
p_list =  list(map(int,input().split()))
p_list.sort()
count_one = 0
count_two = 0
count_three = 0
for i in p_list:
    if i <= A:
        count_one += 1
    elif B < i:
        count_three += 1
    else:
        count_two += 1
print(min(count_one,count_two,count_three))

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

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

for i in p:
    if i <= A:
        a.append(i)
    elif (A+1 <= i) and (i <= B):
        b.append(i)
    else:
        c.append(i)

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()))
q1 = []
q2 = []
q3 = []
for i in range(len(p)):
    if(p[i]<=a):
        q1.append(p[i])
    elif(p[i]>a and p[i]<=b):
        q2.append(p[i])
    else:
        q3.append(p[i])
print(min(len(q1), len(q2), len(q3)))

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

Solution (Python):

"""
Created on Sat Jan 12 20:43:52 2019

@author: Owner
"""


"""
Created on Sat Jan 12 20:43:41 2019

@author: Owner
"""


"""
Created on Sat Dec 29 18:42:51 2018

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""
"""
Created on Sat Jan 12 20:43:41 2019

@author: Owner
"""


"""
Created on Sat Dec 29 18:42:51 2018

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
    
all(nstr.count(c) for c in '753')
"""

N = int(input())
A, B = map(int, input().split())
P = [0]*N
P[:] = map(int, input().split())

P.sort()

num1 = len([i for i in P if i <= A])
num3 = len([i for i in P if i >= B+1])
num2 = N-num1-num3

num = min(num1, num2, num3)
print(num)

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

    r1 = len(list(filter(lambda x: x <= a, scores)))
    r2 = len(list(filter(lambda x: a < x <= b, scores)))
    r3 = len(list(filter(lambda x: b < x, scores)))

    print(min(r1,r2,r3))


    return

main()

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


a,b,c = 0,0,0
list = []
for p in plist:
    if p <= A:
        a += 1
    elif A+1 <= p <= B:
        b += 1
    elif B+1 <= p:
        c += 1

list.append(a)
list.append(b)
list.append(c)

print(min(list))

Solution (Python):
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
t1 = sum(1 for x in p if x <= a)
t2 = sum(1 for x in p if a+1 <= x and x <= b)
t3 = sum(1 for x in p if x >= b+1)
print(min(t1, t2, t3))

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

first_problems = []
second_problems = []
third_problems = []
for problem in problems:
    if problem <= A:
        first_problems.append(problem)
    elif problem <= B:
        second_problems.append(problem)
    else:
        third_problems.append(problem)
        
print(min(len(first_problems), len(second_problems), len(third_problems)))

Solution (Python):
n = int(input())
a, b = map(int, input().split())
probs = [int(x) for x in input().split()]
probs.sort()

intervals = [0, 0, 0]
point = 0

for x in probs:
    if point == 0:
        if x <= a:
            intervals[0] += 1
        else:
            point += 1
    if point == 1:
        if x <= b:
            intervals[1] += 1
        else:
            point += 1
    if point == 2:
        intervals[2] += 1

print(min(intervals))

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

t = [0, 0, 0]
for i in range(n):
    if(p[i] <= a):
        t[0] += 1
    elif(p[i] >= a+1 and p[i] <= b):
        t[1] += 1
    else:
        t[2] += 1

print(min(t))

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

t = [0, 0, 0]
for i in range(n):
    if(p[i] <= a):
        t[0] += 1
    elif(p[i] >= a+1 and p[i] <= b):
        t[1] += 1
    else:
        t[2] += 1

print(min(t))

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

cd1 = 0
cd2 = 0
cd3 = 0

for n in li:
    if n <= A: cd1 += 1
    elif n >= A + 1 and n <= B : cd2 += 1
    elif n >= B+1: cd3 += 1

print(min(cd1, cd2, cd3))

Solution (Python):
from sys import stdin, stdout
from math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial
from random import randint

n = int(stdin.readline())
a, b = map(int, stdin.readline().split())
cnt = [0, 0, 0]

values = list(map(int, stdin.readline().split()))
for v in values:
    if v <= a:
        cnt[0] += 1
    elif v <= b:
        cnt[1] += 1
    else:
        cnt[2] += 1

stdout.write(str(min(cnt)))

Solution (Python):

import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
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)
fc = len(f)
sc = len(s)
tc = len(t)
print(min(fc, sc, tc))

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

Solution (Python):
n = int(input())
a, b = map(int, input().split())
A = [int(i) for i in input().split()]
p1= 0
p2 = 0
p3 = 0

for i in range(n):
    if A[i] <= a:
        p1 += 1
    elif A[i] >= a + 1 and A[i] <= b:
        p2 += 1
    else:
        p3 += 1

print(min(p1, p2, p3))

Solution (Python):
N = int(input())
A, B = map(int,input().split(" "))
P = [int(p) for p in input().split(" ")]
prob1 = [p for p in P if p <=A]
prob2 = [p for p in P if A<p<=B]
prob3 = [p for p in P if B<p]
print(min(len(prob1),len(prob2),len(prob3)))

Solution (Python):
import sys


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


N = ii()
A, B = il()
P = il()
q1 = [p for p in P if p <= A]
q2 = [p for p in P if A + 1 <= p <= B]
q3 = [p for p in P if B + 1 <= p]
print(min(len(q1), len(q2), len(q3)))

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

q1 = sum(1 for i in P if i <= A)
q2 = sum(1 for j in P if (j > A and j <= B))
q3 = sum(1 for k in P if k > B)

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

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

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

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

first = 0 
second = 0 
third = 0  

for p in P:
    if p<=A:
        first += 1     
    elif p<=B:
        second += 1     
    else:
        third += 1
print(min(first,second,third))

Solution (Python):
def solve(A, B, arr):
  lowNum = len(list(filter(lambda n: n <= A, arr)))
  highNum = len(list(filter(lambda n: n > B, arr)))
  midNum = len(arr) - lowNum - highNum
  return min([lowNum, midNum, highNum])

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

print(solve(A, B, arr))

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

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

print(min(len(x),len(y),len(z)))

Solution (Python):
n = int(input())
a,b = map(int,input().split())
p = [int(x) for x in input().split()]
low = 0
middle = 0
high = 0
for i in p:
    if(i<=a):
        low+=1
    elif(i<=b):
        middle+=1
    else:
        high+=1

l = [low,middle,high]
print(min(l))

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

num = [0, 0, 0]

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

print(min(num))

Solution (Python):

import sys
input = sys.stdin.readline

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

a = sum(1 for x in lst_P if x<=A)
b = sum(1 for x in lst_P if A<x<=B)
c = sum(1 for x in lst_P if x>B)

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

Solution (Python):
n = int(input())
a, b = [int(i) for i in input().split()]
ps = sorted([int(i) for i in input().split()])
p1 = len([True for p in ps if p <= a])
p2 = len([True for p in ps if a < p <= b])
p3 = len([True for p in ps if b < p])
print(min(p1, p2, p3))

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

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

low = []
middle = []
high = []

for i in range(len(P)):
    P[i] = int(P[i])
    if P[i] <= A:
        low.append(P[i])
    elif P[i] <= B:
        middle.append(P[i])
    else:
        high.append(P[i])

atta = [len(low), len(middle), len(high)]

print(min(atta))

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+1<=p<=B]),len([p for p in P if B+1<=p])))

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

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

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

for num in P:
    if num<=A:
        a.append(num)
    elif num>=(A+1) and num<=B:
        b.append(num)
    else:
        c.append(num)
        
print(min(len(a), len(b), len(c)))

Solution (Python):
import math as mt
import itertools as it
import functools as ft
import random as rnd

stdin = lambda type_ = "int", sep = " ": list(map(eval(type_), input().split(sep)))
joint = lambda sep = " ", *args: sep.join(str(i) if type(i) != list else sep.join(map(str, i)) for i in args)

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

_1, _2, _3 = 0, 0, 0

for p in P:
    if p <= A:
        _1 += 1
    elif p <= B:
        _2 += 1
    else:
        _3 += 1

print(min(_1, _2, _3))

Solution (Python):
N = int(input())
A, B = map(int, input().split())
P = [int(i) for i in input().split()]
q1 = [i for i in P if i <= A]
q2 = [i for i in P if A < i <= B]
q3 = [i for i in P if B < i]
print(min(len(q1), len(q2), len(q3)))

Solution (Python):


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

P.sort()
a_count = len([i for i in P if i<= A])
b_count = len([i for i in P if A < i <= B])
c_count = len([i for i in P if B < i])

print(min(a_count,b_count,c_count))

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

first=0
second=0
third=0

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

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

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):
N=int(input())

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

S1 = len(list(filter(lambda x : x <=A , P)))
S2 = len(list(filter(lambda x : x > A and x<= B , P)))
S3 = len(list(filter(lambda x : x > B , P)))

print("%d" % (min(S1, min(S2, S3))))

Solution (Python):


import numpy
import scipy

N = int(input())
A,B = [int(x) for x in input().split(" ")]
P = [int(x) for x 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))

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):
import sys
input = sys.stdin.readline
N = int(input())
A, B = map(int, input().split())
nums = list(map(int, input().split()))
lis = [0, 0, 0]

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

Solution (Python):
import numpy as np

N = int(input())
A, B = list(map(int, input().split(" ")))
p_array = np.asarray(sorted(list(map(int, input().split(" ")))))

type_1 = (p_array <= A)
type_3 = (p_array >= B+1)
type_2 = (~type_1) * (~type_3)

out = min([sum(type_1), sum(type_2), sum(type_3)])

print(out)

Solution (Python):

import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    
    import numpy
    def dprint(*args, **kwargs):
        
        
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') 
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') 
    atexit.register(lambda :sys.stdout.close())     
    
N, = getIntList()


A,B  = getIntList()
zp  = getIntList()

zp.sort()
r0 = 0
r1 = 0
r2 = 0
for x in zp:
    if x<= A:
        r0 +=1
    elif x>B:
        r2+=1
    else:
        r1 +=1
print( min(r0,r1,r2))

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

P.sort()
a,b,c=0,0,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 = list(map(int, input().split()))
q1 = q2 = q3 = 0
for i in P:
	if i <= A:
		q1 += 1
	elif 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()))


first = []
second = []
final = []

for ele in p:
    if ele <= a:
        first.append(ele)
    elif ele <= b:
        second.append(ele)
    else:
        final.append(ele)

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

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

Solution (Python):
N = int(input())
A, B = map(int, input().split())
Pn = list(map(int, input().split()))
a = 0
b = 0
c = 0
for p in Pn:
    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 = [int(x) for x in input().split()]
score = [0, 0, 0]
lst = [int(x) for x in input().split()]
for i in lst:
    if i <= A:
        score[0] += 1
    elif i <= B:
        score[1] += 1
    else:
        score[2] += 1
    
print(min(score))

Solution (Python):
N = int(input())
A,B = map(int, input().split())
P = list(map(int, input().split()))
print(min(sum(p<=A for p in P),sum(A<p and p<=B for p in P),sum(B<p for p in P)))

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

import numpy as np
P=np.array(P)

print min(len(np.where(P<=A)[0]),len(np.where((P>A) & (P<=B))[0]),len(np.where(P>B)[0]))

Solution (Python):
n = int(input())
a,b = map(int, input().split())
p = [int(i) for i in input().split()] 
count1 = 0
count2 = 0
count3 = 0
for i in p:
    if i <= a:
        count1 += 1
    if a+1 <= i <= b:
        count2 += 1
    if b+1 <= i:
        count3 += 1
print(min(count1,count2,count3))

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

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