import Foundation
 
let input_line = readLine()!
 
let split = input_line.componentsSeparatedByString(" ") //components(separatedBy:)と実質同じ
let N = Int(input_line)!
 
var Pi = [Int]()
let input_line2 = readLine()!

let splits = input_line2.componentsSeparatedByString(" ") //components(separatedBy:)と実質同じ
Pi = splits.map {Int($0)!}.sort()
print(Pi[N / 2] - Pi[N / 2 - 1])