#include <bits/stdc++.h>
using namespace std;
int val(int x){
	if(x > 3) return 0;
	return (4 - x) * 100000;
}
int main(){
	int x, y; cin >> x >> y;
	cout << val(x) + val(y) + (x == 1 && y == 1) * 400000<< endl;
	return 0;
}
