function main(input) {
    var a = input[0]-0;
    var b = input[1]-0;
    var c = input[2]-0;
    var d = input[3]-0;
    
    console.log(Math.min(a,b)+Math.min(c,d));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
