nums = gets.split(" ").map(&:to_i)
x = nums[0]
y = nums[1]

prize = 0

if x == 1 && y == 1
  prize += 400000
end

if x == 3 
  prize += 100000
elsif x == 2
  prize += 200000
elsif x == 1
  prize += 300000
end

if y == 3
  prize += 100000
elsif y == 2
  prize += 200000
elsif y == 1
  prize += 300000
end
puts prize