module A = Array
module C = Char
module I = Int64
module L = List
module Q = Queue

let pf = Printf.printf
let sf = Scanf.scanf
let ssf = Scanf.sscanf

let read_int () = sf "%d " (fun x -> x)
let read_float () = sf "%f " (fun x -> x)
let read_array read n = A.init n (fun _ -> read ())
let err s = raise (Failure s)

let rec solve xs n res
    = if n = 0 then
        res
      else
        solve xs (n-1) (res + xs.(A.length xs -n*2))

let _ =
    let n = read_int () in
    let size = n * 3 in
    let a = read_array read_int size in
    A.sort compare a;
    solve a n 0 |> pf "%d\n"
    
