def ddcc2020_qual_a
    x,y = gets.chomp.split(/\s/).map{|x| x.to_i}

    yen = 0
    yen += 100000 if x == 3
    yen += 200000 if x == 2
    yen += 300000 if x == 1
    yen += 100000 if y == 3
    yen += 200000 if y == 2
    yen += 300000 if y == 1
    yen += 400000 if x == 1 and y == 1

    puts yen
end

ddcc2020_qual_a