let f s = Str.split (Str.regexp " ") s
          |> List.map int_of_string
          |> List.fold_left (+) 0
;;

let () =
  let a = read_line () |> f and
      b = read_line () |> f in
  Printf.printf "%d\n" (if a < b then b else a)
;;