def cal_price(x)
  if x == 1
    price = 300000
  elsif x == 2
    price = 200000
  elsif x == 3
    price = 100000
  else
    price = 0
  end
  return price
end

X, Y = gets.split(' ').map(&:to_i)
price = 0
price += cal_price(X)
price += cal_price(Y)
price += 400000 if X == 1 && Y == 1
puts price