fun main(args: Array<String>) {
    val (x, y) = readLine()!!.split(" ").map { it.toInt() }
    var results = (1..205).map { it * 0 }.toMutableList()
    results[0] = 300000
    results[1] = 200000
    results[2] = 100000
    if (x==1 && y==1) println(results[x-1]+results[y-1]+400000)
    else println(results[x-1]+results[y-1])
}