function Main(input){
  var inp = input.split('\n');
  var A = parseInt(inp[0].trim());
  var B = parseInt(inp[1].trim());
  var C = parseInt(inp[2].trim());
  var D = parseInt(inp[3].trim());

  var max1 = Math.min(A, B);
  var max2 = Math.min(C, D);
  console.log(max1+max2); 
  
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
