main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
function main(chunk){
    var a = eval(chunk.split("\n")[0].replace(/ /g,"+"));
    var b = eval(chunk.split("\n")[1].replace(/ /g,"+"));
    console.log(Math.max(a,b));
}