#include <bits/stdc++.h>
using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;

    int prize = 100000 * (max((4 - x), 0) + (max(0, (4 - y))));

    if (x == 1 && y == 1)
    {
        prize += 400000;
    }

    cout << prize << endl;
}