{-# LANGUAGE OverloadedStrings #-}
import           Data.Attoparsec.ByteString.Char8
import qualified Data.ByteString.Char8

main :: IO ()
main = do
  Right (x, y) <- parseOnly ((,) <$> decimal <* space <*> decimal) <$> B.getLine
  print $ solve x y

solve :: Int -> Int -> Int
solve 1 1 = 1000000
solve x y = f x + f y
  where
    f 1 = 300000
    f 2 = 200000
    f 3 = 100000
    f _ = 0