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){
    sum+=a
  }
  else{
    sum+=b 
  }
  if(c<d){
    println(sum+c)
  }
  else{
    println(sum+d)
  }
}