function Main(input) {
  var inputs = input.split(' ')
  var code = inputs[0]
  var zissou = inputs[1]
  var result = 0
  switch (code) {
    case '1':
      result += 300000
      break
    case '2':
      result += 200000
      break
    case '3':
      result += 100000
      break
    default:
  }
  switch (zissou) {
    case '1':
      result += 300000
      break
    case '2':
      result += 200000
      break
    case '3':
      result += 100000
      break
    default:
  }
  if (code == 1 && zissou == 1) {
    result += 400000
  }
  console.log(result)
}

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