function Main(input) {
  var tmp = input[0].split(" ");
  var x = parseInt(tmp[0], 10);
  var y = parseInt(tmp[1], 10);

  var total = 0;
  if (x == 1 && y == 1) {
    total += 400000;
  }
  if (x == 1) {
    total += 300000;
  }
  if (x == 2) {
    total += 200000;
  }
  if (x == 3) {
    total += 100000;
  }
  if (y == 1) {
    total += 300000;
  }
  if (y == 2) {
    total += 200000;
  }
  if (y == 3) {
    total += 100000;
  }

  console.log("%s", total);
}

Main(
  require("fs")
    .readFileSync("/dev/stdin", "utf8")
    .split("\n")
);
