var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
var a=Arr[0].split(" ").map(Number);
var b=Arr[1].split(" ").map(Number);
var sumA=a.reduce(function(a,b){return a+b;});
var sumB=b.reduce(function(a,b){return a+b;});
console.log(Math.max(sumA,sumB));