program main
  implicit none
  integer :: n, m, x, pre, post, i
  integer :: a(100)
  read(*, *) n, m, x
  read(*, *) a(1:m)
  pre = 0
  post = 0
  do i = 1, m
    if (a(i) < x) then
      pre = pre + 1
    else
      post = post + 1
    end if
  end do
  write(*, "(i0)") min(pre, post)
end program main
