# Your code here!
x,y=gets.split(" ").map(&:to_i)
z=100000
total=0
case x
when 3 then
    total+=z
when 2 then
    total+=z*2
when 1 then
    total+=z*3
else
    total+=0
end

case y
when 3 then
    total+=z
when 2 then
    total+=z*2
when 1 then
    total+=z*3
else
    total+=0
end

if x==y&&x==1
    total+=100000*4
end

p total