#include <bits/stdc++.h>
using namespace std;
int main(){
	//freopen("","r",stdin);
	//freopen("","w",stdout);
	int a[1000]={0};
	a[1]=300000;
	a[2]=200000;
	a[3]=100000;
	int x,y,sum=0;
	cin>>x>>y;
	sum+=a[x];
	sum+=a[y];
	if(x==y&&y==1){
		sum+=400000;
	}
	cout<<sum;
}
