x, y = gets.split.map &:to_i

sum = 0

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

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

if x == 1 && y == 1 then
	sum += 400000
end

puts sum
