function main (s) {
	var a=s.split("\n");
	for(var i=0;i<s.length;i++)a[i]=parseInt(a[i]);
	console.log(Math.min(a[0],a[1])+Math.min(a[2],a[3]));
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));