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

answer = 0

answer += 
  case x
  when 1
    3
  when 2
    2
  when 3
    1
  else
    0
  end

answer += 
  case y
  when 1
    3
  when 2
    2
  when 3
    1
  else
    0
  end

if x == 1 && y == 1
  answer += 4
end

puts answer * 100000
