function Main(input) {
    input = input.split(" ");
    var X = a(parseInt(input[0],10));
    var Y = a(parseInt(input[1],10));
    if(X == 300000 && Y == 300000){
        console.log(X+Y+400000);
    }else{
        console.log(X+Y)
    }
    function a(b){
        if(b == 1){
            return 300000;
        }else if(b == 2){
            return 200000;
        }else if(b == 3){
            return 100000;
        }else{
            return 0;
        }
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));