import scala.io._
object Main {
def main(args: Array[String]) {
val input = Source.fromInputStream(System.in)
val lines = input.getLines.toSeq

val A = lines.take(2).map(_.toInt)
val B = lines.drop(2).map(_.toInt)
var res = 0

if(A(0) > A(1)) {res += A(0)}
else {res += A(1)}
if(B(0) > B(1)) {res += B(0)}
else {res += B(1)}

println(res)