x, y = gets.split.map(&:to_i)
v = 0
case x
when 1
  v += 300000
when 2
  v += 200000
when 3
  v += 100000
end
case y
when 1
  v += 300000
when 2
  v += 200000
when 3
  v += 100000
end
v += 400000 if x == 1 && y == 1
puts v
