x,y = gets.split(" ").map(&:to_i)
sum = 0
ans = true

if x == 1 && y == 1
    puts 1000000
    ans = false
else
    if x == 2
        sum += 200000
    elsif x == 3
        sum += 100000
    end
    if y == 2
        sum += 200000
    elsif y == 3
        sum += 100000
    end
end

if ans
    puts sum
end
