import Control.Applicative

main :: IO ()
main = solve <$> f >>= print
  where
    f = map read <$> words <$> getLine

solve :: [Int] -> Int
solve [x, y]
  | x == 1 && y == 1 = 1000000
  | otherwise = f x + f y
  where
    f 1 = 300000
    f 2 = 200000
    f 3 = 100000
    f _ = 0
