object Main extends App {
	import scala.math._
	val A = scala.io.StdIn.readInt
	val B = scala.io.StdIn.readInt
	val C = scala.io.StdIn.readInt
	val D = scala.io.StdIn.readInt

	println(min(A,B) + min(C,D))

}