Scanf.sscanf (read_line ()) "%d %d" (fun a b ->
    let f = function
        | 1 -> 300000
        | 2 -> 200000
        | 3 -> 100000
        | _ -> 0
    in
    let r = f a + f b + (if a * b = 1 then 400000 else 0) in
    Printf.printf "%d\n" r)