type ABC(stream:System.IO.TextReader) =
  member this.Scan1 f = stream.ReadLine() |> f
  member this.ScanVecH f = stream.ReadLine().Split() |> Array.map f

let util = ABC(stdin)

let N = util.Scan1 int
let Xs = util.ScanVecH int |> Array.sort

printfn "%d" <| Xs.[N/2] - Xs.[N/2 - 1]