#include <stdio.h>

int main(void)
{
  int m = 0;
  int a, b;
  scanf("%d %d", &a, &b);

  switch (a)
  {
  case 1:
    m += 300000;
    break;
  case 2:
    m += 200000;
    break;
  case 3:
    m += 100000;
    break;
  }
  switch (b)
  {
  case 1:
    m += 300000;
    break;
  case 2:
    m += 200000;
    break;
  case 3:
    m += 100000;
    break;
  }

  printf("%d\n", m);

  return 0;
}