import std.stdio;
import std.array;
import std.conv;
import std.string;
import std.algorithm;

void main(){
    int sScore = 0; int tScore = 0;
    string[] sInput = readln().split();
    string[] tInput = readln().split();
    foreach(string s; sInput){
        sScore += s.to!int();
    }
    foreach(string s; tInput){
        tScore += s.to!int();
    }
    if(sScore > tScore){
        writeln(sScore);
    }else{
        writeln(tScore);
    }
}