fun main(args: Array<String>) {
    ddcc2020quala()
}

fun ddcc2020quala() {
    val xy = readLine()!!.split(' ').map { it.toInt() }

    val list = listOf(300000, 200000, 100000)
    val answer = if (xy.all { it == 1 }) 1000000 else xy.map { if (it in 1..3) list[it - 1] else 0 }.sum()
    
    println(answer)
}
