#include<cstdio>
int a,b,ans;
int main()
{
	scanf("%d%d",&a,&b);
	if(a==1)ans+=3;
	else if(a==2)ans+=2;
	else if(a==3)ans++;
	if(b==1)ans+=3;
	else if(b==2)ans+=2;
	else if(b==3)ans++;
	if(ans==6)ans+=4;
	ans*=100000;
	printf("%d",ans);
	return 0;
}