import scala.io.StdIn._
object Main extends App{
  val sc = new java.util.Scanner(System.in)
  var a,b,c,d = sc.nextInt
  var sum=0
  if(a<b){
    if(c<d){
      println(a+c)
    }
    else{
      println(a+d)
    }
  }
  else{
    if(c<d){
      println(b+c)
    }
    else{
      println(b+d)
    }
  }
}