A=io.read("n")
B=io.read("n")
C=io.read("n")
X=io.read("n")
Y=io.read("n")
local cost=0
if C*2<=math.min(A,B) then
  cost=C*2*math.max(X,Y)
  elseif C*2>=A+B then
    cost=A*X+B*Y
  elseif C*2<A+B and C*2>=math.max(A,B) then
    if X>Y then
      cost=C*2*math.min(X,Y)+math.abs(X-Y)*A
    else 
      cost=C*2*math.min(X,Y)+math.abs(X-Y)*B
    end
  elseif C*2>math.min(A,B) and C*2<math.max(A,B) then
    if A<B and X<Y or A>B and X>Y then
      cost=C*2*math.max(X,Y)
    elseif A<B and X>Y then
      cost=C*2*Y+A*(X-Y)
    elseif  A>B and X<Y then
      cost=C*2*X+B*(Y-X)
    end
end
print(cost)