'use strict'

function main(s) {

  s = s.split('\n');
  const a = Number(s[0]);
  const b = Number(s[1]);
  const c = Number(s[2]);
  const d = Number(s[3]);

  const ans = Math.min(a, b) + Math.min(c, d);
  console.log(ans);
}

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