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

const int VAL[3] = {300000, 200000, 100000};

int x, y;

signed main(){
	cin >> x >> y;
	--x; --y;
	int ans = 0;
	if(x < 3) ans += VAL[x];
	if(y < 3) ans += VAL[y];
	if(x == 0 && y == 0) ans += 400000;
	cout << ans;
}