#include <iostream>
using namespace std;

int main(){
	int x,y;
	scanf("%d%d",&x,&y);
	
	int ret = 0;
	if(x <= 3)ret += (4-x)*100000;
	if(y <= 3)ret += (4-y)*100000;
	if(ret == 600000)ret += 400000;
	cout << ret << endl;
}