import Control.Monad
import Data.Maybe
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector as V

main = abc132c

abc132c = do
    n  <- getIntList
    dL <- getIntList
    let (small, large) = getMedian dL
    print $ large - small
    
getMedian :: [Integer] -> (Integer, Integer)
getMedian dL = let sorted = V.fromList (sort dL)
                   num = V.length sorted
                in (sorted V.! (div num 2 - 1), sorted V.! div num 2)

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine