class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize
    @x,@y = gets.split.map(&:to_i)    
  end

  def solve
    ans = query(x) + query(y) + bonus(x,y)
  end

  def query(x)
    return 0 if 3 < x
    (4 - x) * 100_000
  end

  def bonus(x,y)
    x == 1 && y == 1 ? 400_000 : 0
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end