A,B,C,X,Y = gets.split(" ").map { |e| e.to_i }
zisyo = {:A => X, :B => Y}
count = 0

if (B+A)/2 <= C
  count = A*X + B*Y
elsif C*2 < A and C*2 < B
  count = C*[X,Y].max*2
else
  # toku = b - (C*2 - s) #AB2枚で得する分
  # if zisyo[:s] < zisyo[:b]
  if X<Y
    count = C*X*2 + B*(Y-X)
  else
    count = C*2*Y + A*(X-Y)
  end
end

# elsif C*2 < A
#   count += C*X*2
#   if X < Y
#     count += B*(Y-X)
#   end
# elsif C*2 < B
#   count += C*Y*2
#   if Y < X
#     count += A*(X-Y)
#   end
# else
#   s = [A,B].min
#   b = [A,B].max
#   count = C*s
# end

puts count
