#include<bits/stdc++.h>
using namespace std;

int main(){
  int X,Y;
  int A=0;
  cin>>X;
  cin>>Y;
  if(X==1)A+=300000;
  if(X==2)A+=200000;
  if(X==3)A+=100000;
  if(Y==1)A+=300000;
  if(Y==2)A+=200000;
  if(Y==3)A+=100000;
  if(X==1&&Y==1)A+=400000;
  cout<<A<<endl;
  return 0;
}