input = gets.chomp.split(" ").map(&:to_i)

X = input[0]
Y = input[1]
money = 0

case X
when 1 then
  money += 300000
when 2 then
  money += 200000
when 3 then 
  money += 100000
end
  
case Y
when 1 then
  money += 300000
when 2 then
  money += 200000
when 3 then
  money += 100000
end
  
if money == 600000
  money += 400000
end
  
puts money