"use strict";

function main(arg) {
    arg     = arg.split("\n");
    const A = parseInt(arg[0]);
    const B = parseInt(arg[1]);
    const C = parseInt(arg[2]);
    const D = parseInt(arg[3]);
    
    console.log(Math.min(A,B) + Math.min(C,D));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));