open Batteries;;

let rec check la lb count =
  match la, lb with
  | hda :: [] , hdb :: [] -> count + hda + hdb
  | [], _ -> List.fold_left (+) count lb
  | hda :: resta, hdb :: restb ->
     max (check [] lb (count+hda)) (check resta restb (count+hda))
    in
    let n = read_int () in
let lista = read_line () |> String.split_on_char ' ' |> List.map int_of_string in
let listb = read_line () |> String.split_on_char ' ' |> List.map int_of_string in
let ans = check lista listb 0 in
print_int ans
;;