function Main(input) {
  input = input.split(" ").map(Number);
  var sum = 0;
  if(input[0]<4){
    sum += (4-input[0])*100000;
  }
  if(input[1]<4){
    sum += (4-input[1])*100000;
  }
  if(sum == 600000){
    sum = 1000000;
  }
  console.log(sum);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
