import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

void main() {
  int x, y;
  readf (" %d %d", &x, &y);
  auto a = [x, y];
  int r;
  foreach (i; a) {
    if (i == 3) r++;
    if (i == 2) r+=2;
    if (i == 1) r+=3;
  }
  if (a.all!"a == 1") r += 4;
  writeln(r * 100_000);
}

