let i_inp : unit -> int = fun () ->
  int_of_string (input_line stdin)

let inp_loop_array : 'a array -> int -> unit = fun a n ->
  let rec loop i = 
    if i = n then ()
    else
      (a.(i) <- (Scanf.scanf " %d" (fun x -> x));
       loop (i + 1))
  in loop 0 
   
let () =
  let n = i_inp () in
  let a = Array.make n 0 in
  let () = inp_loop_array a n in
  if n mod 2 <> 0 then (print_int 0; print_newline ())
  else
    let () = Array.sort (fun a b -> if a > b then 1 else if a = b then 0 else -1) a in 
    print_int (a.(n / 2) - a.(n / 2 -1));
    print_newline ()
      
        
