
fun func( map : Map<Int,Int> , num : Int) : Int {
    var ret = map.get(num)
    if( ret != null ){
        return ret
    } else {
        return 0
    }
}

fun main(args : Array<String>){
    val map = mutableMapOf<Int, Int>(1 to 300000 , 2 to 200000 , 3 to 100000)
    val str = readLine()?.split(" ")?.map(String::toInt)

    var sum = 0
    if (str != null) {
        for( s in str ){
            sum += func(map, s)
        }

        if(str[0] == 1 && str[1] == 1 ){
            sum += 400000
        }
    }

    print(sum)
}