let id x = x in
let id2 x y = x in
let n = Scanf.scanf "%d" id in
let lista = (Array.to_list @@ Array.init n (fun _ ->
    Scanf.scanf "%d ^\n" id )) in
let _ =Scanf.scanf "\n" (fun _ -> ()) in
let listb = (Array.to_list @@ Array.init n (fun _ ->
    Scanf.scanf "%d ^\n" id )) in

let rec check la lb count =
  match la, lb with
  | [], [] -> count 
  | hda :: resta, hdb :: restb ->
     max (check resta restb (count+hda)) (check [] restb (count+hda+hdb))
in

let ans = check lista listb 0 in

print_int ans
;;