#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
	int x,y; cin>>x>>y;
	int ans;
	ans=max(300000-100000*(x-1),0)+max(300000-100000*(y-1),0);
	if(x==1&&y==1){
		ans+=400000;
	}
	cout<<ans<<endl;
	    
}
