require 'pp'

def gets; ARGF.gets; end

class Solver

  def initialize
  end

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

    ans = 0
    ans += if x == 1
             300000
           elsif x == 2
             200000
           elsif x == 3
             100000
           else
             0
           end

    ans += if y == 1
             300000
           elsif y == 2
             200000
           elsif y == 3
             100000
           else
             0
           end

    if x == 1 && y == 1
      ans += 400000
    end

    puts ans
  end
end

if __FILE__ == $0
  Solver.new.main
end
