program main
  implicit none
  
  integer :: n,m,x,a(100),i,j,b(100)=0,ss=0,bb=0
  
  read(*,*)n,m,x
  read(*,*)(a(i),i=1, m)
  do i = 1, n
    do j = 1, m
      if (i == a(j)) then
        b(i) = 1
      end if
    end do
  end do
  
  do i = 1, x-1
    ss = ss + b(i)
  end do
  do i = x+1,100
    bb = bb + b(i)
  end do
  
  write(*,*)min(ss,bb)
end program main
