x,y = gets.split.map(&:to_i)
z = 0
if x == 1
  z += 300000
elsif x == 2
  z += 200000
elsif x == 3
  z += 100000
end

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

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

puts z