
[<EntryPoint>]
let main argv = 
    let numOfProblems = stdin.ReadLine() |> int

    let scoreOfProblems = stdin.ReadLine().Split(' ') |> Array.map int |> Array.sort

    let idx1 = numOfProblems / 2
    let idx2 = idx1 - 1

    printfn "%d" (scoreOfProblems.[idx1] - scoreOfProblems.[idx2])

    0 // return an 