#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int x,y;
    cin>>x>>y;
    cout<<(x<=3?(4-x)*100000:0)+(y<=3?(4-y)*100000:0)+(x==1&&y==1?400000:0)<<endl;
}
