#include<bits/stdc++.h>
using namespace std;
int x,y;
int main()
{
  cin>>x>>y;
  if(x==1&&y==1) cout<<1000000;
  else
  {
    int z=(4-x>=1?(4-x)*100000:0);
    int z1=(4-y>=1?(4-y)*100000:0);
   	cout<<z+z1;
  }
}
