"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.  Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.
A, B, C, X, Y = map(int,input().split())
if A+B <= C*2:
  print(A*X + B*Y)
else:
  if X>=Y:
    print(Y*C + (X-Y)*A)
  else:
    print(X*C + (Y-X)*B)

A, B, C, X, Y = map(int,input().split())
ans = float('inf')
for i in range(0, max(X,Y)+1):
  num = i*2*C + max(0, X-i)*A + max(0, Y-i)*B
  ans = min(ans, num)
print(ans)