(* O(2^N) *)
let solve n vs cs =
  let rec loop i x y =
    if i >= n then
      x - y
    else
      max
        (loop (i + 1) (x + vs.(i)) (y + cs.(i)))
        (loop (i + 1) x y)
  in
    loop 0 0 0

let read_ints () = read_line () |> Str.split (Str.regexp " ") |> List.map int_of_string

let list_to_array n a xs =
  let res = Array.make n a in
  List.iteri (fun i x -> res.(i) <- x) xs;
  res

let _ =
  let n = read_int () in
  let vs = read_ints () |> list_to_array n 0 in
  let cs = read_ints () |> list_to_array n 0 in
  solve n vs cs |> string_of_int |> print_endline