def price(x)
  case x
  when 1 then 300000
  when 2 then 200000
  when 3 then 100000
  else 0
  end
end

x, y = gets.split.map(&:to_i)
z = 0
z = 400000 if x == 1 && y == 1
puts z +  price(x) + price(y)