function Main(s) {
	s = s.split("\n").map(a => parseInt(a));
	
	console.log((s[0] > s[1] ? s[1] : s[0]) + (s[2] > s[3] ? s[3] : s[2]));
}

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