main = do
  [_,m,x] <- map read . words <$> getLine
  a <- map read . words <$> getLine
  let left =maximum $ 0 : [i+1 | i <- [0..m-1],a !! i < x]
      right = maximum $ 0 : [m-i | i <- [0..m-1],a !! i > x] 
  print $ min left right