function Main(input) {
  input = input.trim()
 input = input.split("\n").map(Number);
 var sum =0;
 if(input[0]>input[1]){
sum+=input[1]
 }else{
sum+=input[0]
 }
 if(input[2]>input[3]){
sum+=input[3]
 }else{
sum+=input[2]
 }
 console.log(sum)
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));