import Data.List (sort)

main = do
  getLine
  li <- getLine
  let ds = map read $ words li
  let answer = compute ds
  print answer

compute :: [Int] -> Int
compute ds = d2 - d1
  where
    ds1 = sort ds
    n2 = length ds `div` 2
    d1 : d2 : _ = drop (n2-1) ds1
