score_a = STDIN.readline.chomp
            .split(" ")
            .lazy.map(&:to_i)
            .inject(:+)

score_b = STDIN.readline.chomp
            .split(" ")
            .lazy.map(&:to_i)
            .inject(:+)

puts [score_a, score_b].max