Prizes = [300000, 200000, 100000]
Special = 400000

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

  prize = 0

  prize += Prizes[x - 1] if x <= 3
  prize += Prizes[y - 1] if y <= 3

  prize += Special if (x == 1) && (y == 1)

  puts prize.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end