open System 

let R() = Console.ReadLine()

let f (xs: int array): int =
    let len = Array.length xs
    if len % 2 <> 0 then 
        0
    else
        let xs = Array.sort xs 
        let l = len / 2 - 1 
        let r = len / 2
        xs.[r] - xs.[l]

let _ = R()
let d = R().Split() |> Array.map (string>>int)

f d 
|> printfn "%i"