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

int main() {
    int x, y; cin >> x >> y;
    if (x == 1 && y == 1) cout << 1000000 << endl;
    else {
        cout << 100000 * (max(0, 4-x) + max(0, 4-y)) << endl;
    }
    return 0;
}