require 'pp'

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

z = {
    3 => 100000,
    2 => 200000,
    1 => 300000,
}

if x == 1 && y == 1
    puts 400000 + 600000
else
    puts z.fetch(x, 0) + z.fetch(y, 0)
end
