program main
   implicit none
   integer n,a,b
   integer dat(3)
   integer,allocatable,dimension(:)::p
   integer i
   read(*,*)n
   read(*,*)a,b
   allocate(p(n))
   read(*,*)p
   dat=0
   do i=1,n
      if(p(i)<=a)dat(1)=dat(1)+1
            if(p(i)>a .and. p(i)<=b)dat(2)=dat(2)+1
                  if(p(i)>b)dat(3)=dat(3)+1
   enddo
   write(*,*)minval(dat)
end program main
