function Main(input) {
  input = input.split("\n");
  var A = parseInt(input[0]);
  var B = parseInt(input[1]);
  var C = parseInt(input[2]);
  var D = parseInt(input[3]);
  var result = null;
  var result1 = null;
  if (A < B) {
    result = A;
  } else {
    result = B;
  }
  if (C < D) {
    result1 = C;
  } else {
    result1 = D;
  }
  console.log(result + result1);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));