function main(input) {
    var X = input[0].split(" ")[0]-0;
    var Y = input[0].split(" ")[1]-0;
    var ans = 0;
    if(X==1 && Y==1) ans += 400000;
    if(X<=3) ans += (4-X)*100000;
    if(Y<=3) ans += (4-Y)*100000;
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
