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

int main() {
  int X, Y;
  cin >> X >> Y;
  int score[300] = {300000, 200000, 100000};
  int ans = score[X - 1] + score[Y - 1];
  if (ans == 600000) ans += 400000;
  cout << ans << endl;
}