open Batteries
let rec sum lst =
  match lst with
  | [] -> 0
  | first :: rest -> first + sum rest
let get i lst =
  let rec loop l p =
    match l with
    | [] -> []
    | first :: rest ->
      if i = p then [] else first :: loop rest (p+1)
  in loop lst 0
let xyabc = Scanf.sscanf (read_line()) "%d %d %d %d %d" (fun x y a b c ->
  [|x; y; a; b; c|]
)
let p = read_line () |> String.split_on_char ' ' |> List.map int_of_string |> List.sort compare |> List.rev |> get xyabc.(0)
let q = read_line () |> String.split_on_char ' ' |> List.map int_of_string |> List.sort compare |> List.rev |> get xyabc.(1)
let r = read_line () |> String.split_on_char ' ' |> List.map int_of_string |> List.sort compare |> List.rev
let all = List.append p q |> List.append r |> List.sort compare |> List.rev
let _ = Printf.printf "%d\n" @@ sum @@ get (xyabc.(0)+xyabc.(1)) all
