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

def hoge(n)
  if (n == 3)
    return 100000
  elsif (n == 2)
    return 200000
  elsif (n == 1)
    return 300000
  else
    return 0
  end
end

if (x == 1 && y == 1)
  puts 1000000
else
  puts hoge(x) + hoge(y)
end