fun main(args :Array<String>) {
    val (x, y) = readIntegerList()
    val prizes = arrayListOf(0, 300000, 200000, 100000, 0)
    var ans = prizes[Math.min(x, 4)] + prizes[Math.min(y, 4)]
    if (x == 1 && y == 1) {
        ans += 400000
    }

    println(ans)
}

fun readInteger() = readLine()!!.toInt()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
