fun main(args: Array<String>) {
  val sc = java.util.Scanner(System.`in`)
  val A = sc.nextInt()
  val B = sc.nextInt()
  val C = sc.nextInt()
  val D = sc.nextInt()
  println(arrayOf(A, B).min()!! + arrayOf(C, D).min()!!)
}
