fun main(args : Array<String>) {
    val (x, y) = readLine()!!.split(" ").map { it.toInt() }

    var sum = 0
    if (x == 1) sum += 300000
    if (x == 2) sum += 200000
    if (x == 3) sum += 100000

    if (y == 1) sum += 300000
    if (y == 2) sum += 200000
    if (y == 3) sum += 100000

    if (x == 1 && y == 1) sum += 400000

    println(sum)
}