program sample
    implicit none
  
    integer(8) :: i,j,m,n,x,b
    
    integer(8),allocatable :: a(:),y(:)
  
    read(*,*) n,m,x
    allocate(a(m))
    read(*,*)a
    do i=1,m
        if(a(i)>x)then
            b=i
        exit
        end if
    end do
    if (b-1<m-b+1)then
        write(*,*)b-1
    else
        write(*,*)m-b+1
    endif

  
    
    stop
end program sample
  

