import Control.Applicative
import Data.List

main = do
  n <- read <$> getLine :: IO Int
  xs <- (map read).words <$> getLine :: IO [Int]
  let n' = n `div` 2
  let xs' = sort xs
  let s = (xs' !! n') - (xs' !! pred n')
  putStrLn $ show s
