#!/usr/bin/env ruby
# coding: utf-8

g = ARGF.gets.split.map(&:to_i).map do |x|
  (x == 1) ? 300000 : (x == 2) ? 200000 : (x == 3) ? 100000 : 0
end
if g[0] == 300000 && g[1] == 300000
  g[0] += 400000
end
puts g[0] + g[1]
