fun main(args: Array<String>) {
	val ins = mutableListOf<Int>()
	repeat(4) {
		ins.add(readLine()!!.toInt())
	}
	var sum = 0
	if (ins[0] > ins[1]) {
		sum += ins[1]
	} else {
		sum += ins[0]
	}
	if (ins[2] > ins[3]) {
		sum += ins[3]
	} else {
		sum += ins[2]
	}
	println("${sum}")
}