void main() {
    int[] xy = readln.split.to!(int[]);

    int money;
    foreach (i; 0 .. 2) {
        if (xy[i] == 1) {
            money += 300000;
        } else if (xy[i] == 2) {
            money += 200000;
        } else if (xy[i] == 3) {
            money += 100000;
        }
    }
    if (xy.all!"a == 1") money += 400000;

    money.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;