program contests
  implicit none
  integer :: n, a, b, p(100) = 0, i, m(3) = 0
  read(*,*) n
  read(*,*) a, b
  read(*,*) p(1:n)
  do i = 1, n
    if (p(i) <= a) then
      m(1) = m(1)+1
    else if (p(i) <= b) then
      m(2) = m(2)+1
    else
      m(3) = m(3)+1
    end if
  end do
  write(*,'(i0)') minval(m)
end program contests