[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main _ =
    let n = read int
    let ds = reada int |> Array.sort
    let a = ds.[(n-1)/2]
    let b = ds.[n/2]
    printfn "%i" (b - a)
    0