'use strict'

function main(input) {

    input = input.split(/\n|\s/).map(v => ~~v)

    const ans = Math.min(input[0], input[1]) + Math.min(input[2], input[3])

    console.log(ans)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));