program ABC_094_B_TollGates
   implicit none
   integer N, M, X, i, countN
   integer, allocatable :: A(:)
   read(*, *) N, M, X
   allocate(A(1: M))
   read(*, *) A(1: M)
   countN = 0
   do i = 1, M
       if(X > A(i)) then
	      countN = countN + 1
	   end if 
   end do
   write(*, *) min(countN, M - countN)
end program ABC_094_B_TollGates