let () = Scanf.scanf "%d %d" @@ fun x y ->
  Printf.printf "%d\n" @@
  ( if x = 1 then 300000
    else if x = 2 then 200000
    else if x = 3 then 100000
    else 0 ) +
  ( if y = 1 then 300000
    else if y = 2 then 200000
    else if y = 3 then 100000
    else 0 ) +
  ( if x = 1 && y = 1 then 400000
    else 0 )

