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

using ll = long long;
using ld = long double;
using pii = pair<int, int>;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};

int main()
{
    int x[2],ans=0;
    for (int i = 0; i < 2; i++)
    {
        cin>>x[i];
        if(x[i]==1) ans+=300000;
        if(x[i]==2) ans+=200000;
        if(x[i]==3) ans+=100000;
    }
    if(x[0]==1&&x[1]==1) ans+=400000;
    cout<<ans<<endl;

    return 0;
}
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1001001001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

int main()
{
    int x, y;
    cin >> x >> y;
    int ans = 0;
    if (x == 1)
    {
        ans += 300000;
    }
    else if (x == 2)
    {
        ans += 200000;
    }
    else if (x == 3)
    {
        ans += 100000;
    }
    if (y == 1)
    {
        ans += 300000;
    }
    else if (y == 2)
    {
        ans += 200000;
    }
    else if (y == 3)
    {
        ans += 100000;
    }
    if (ans == 600000)
    {
        ans += 400000;
    }
    cout << ans << endl;
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}