# frozen_string_literal: true

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

sum = 0
[x, y].each do |i|
  if i == 1
    sum += 300000
  elsif i == 2
    sum += 200000
  elsif i == 3
    sum += 100000
  end
end
sum += 400000 if x == 1 && y == 1

puts sum
