# https://atcoder.jp/contests/ddcc2020-qual/tasks/ddcc2020_qual_a



X, Y = gets.split.map(&:to_i)
ans=0
if X==1 
    ans+=300000
end
if X==2
    ans+=200000
end
if X==3
    ans+=100000
end
if Y==1 
    ans+=300000
end
if Y==2
    ans+=200000
end
if Y==3
    ans+=100000
end
if X==1 && Y==1
    ans+=400000
end
puts ans
