main = do
    [x,y] <- map read . words <$> getLine
    let p a | a == 1 = 300000
            | a == 2 = 200000
            | a == 3 = 100000
            | otherwise = 0
    print . (p x +) . (p y +) $ if x == 1 && y == 1 then 400000 else 0