import java.io.FileInputStream
import java.util.*


var sc: Scanner = Scanner(System.`in`)
fun main(args: Array<String>) {
    if (args.size > 0) {
        System.setIn(FileInputStream(args[0]))
    }
    sc = Scanner(System.`in`)

    problem()

}

fun problem() {

    val A = Math.min(sc.nextInt(), sc.nextInt())
    val B = Math.min(sc.nextInt(), sc.nextInt())


    //println(brues)
    println(A + B)

}

