Module BBBBBBBB
    Sub Main(ByVal args() As String)
        Dim n As Integer = Console.ReadLine()
    	Dim ab As string = Console.ReadLine()
'    	Dim pn As string = 

    	dim a as integer= split(ab)(0) 
        dim b as integer= split(ab)(1) 
    	dim p(n) as string 
    	p = split(Console.ReadLine())


        dim q1l as integer = 0
        dim q1h as integer = a

        dim q2l as integer = a+1
        dim q2h as integer = b

        dim q3l as integer = b+1
        dim q3h as integer = 20
'     Console.WriteLine(q1l)
'     Console.WriteLine(q1h)
'     Console.WriteLine(q2l)
'     Console.WriteLine(q2h)
'     Console.WriteLine(q3l)
'     Console.WriteLine(q3h)

        dim q1 as integer =0
        dim q2 as integer =0
        dim q3 as integer =0
    
    	for i  as integer = 0 to n-1
    dim pi as integer = cint(p(i))
  '  Console.WriteLine(pi)
    
    if   q1l <= pi andalso  q1h >=pi then
      q1 += 1
    elseif q2l <= pi andalso  q2h>=pi then
      q2 += 1
    Else
            q3 +=1
    end if

        next
    
  if q1<=q2 then
    if q1<= q3 then
       Console.WriteLine(q1)
    else
      Console.WriteLine(q3)
    end if
  else
    if q2<= q3 then
       Console.WriteLine(q2)
    else
      Console.WriteLine(q3)
    end if
    end if
    
 '      Console.WriteLine(q1)
 '      Console.WriteLine(q2)
 '     Console.WriteLine(q3)


    End Sub
End Module
