object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val X, Y = sc.nextInt()
  val price = (i: Int) => i match {
    case 1 => 300000
    case 2 => 200000
    case 3 => 100000
    case _ => 0
  }
  val championPrice = if (X == 1 && Y == 1) 400000 else 0
  println(championPrice + price(X) + price(Y))
}
