
a,b,c,x,y=gets.split.map(&:to_i)
 
result=[]
max=[x,y].max
min=[x,y].min
max_price=0
if max==x
    max_price=a
else
    max_price=b
end

result<<2*c*max
result<<2*c*min+(x-y).abs*max_price

result<<a*x+b*y
p result
p result.min