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