X, Y = gets.split.map &:to_i
kane = 0
if X == 1
	kane += 300000
elsif X == 2
	kane += 200000
elsif X == 3
	kane += 100000
end
if Y == 1
	kane += 300000
elsif Y == 2
	kane += 200000
elsif Y == 3
	kane += 100000
end
if X == 1 && Y == 1
	kane += 400000
end
p kane