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

Int x, y;
Int a[210];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> x >> y;
	a[1] = 300000;
	a[2] = 200000;
	a[3] = 100000;
	cout << a[x] + a[y] + (x+y == 2 ? 400000 : 0) << "\n";
}