A, B, AB, X, Y = map(int, input().split())
if min(A, B) >= AB * 2:
  print(max(X, Y) * 2 * AB)
elif max(A, B) >= AB * 2:
  print(min(X, Y) * 2 * AB + (max(X, Y) - min(X, Y)) * AB * 2)
elif A + B >= AB * 2:
  print(min(X, Y) * 2 * AB + (max(X, Y) - min(X, Y)) * (A, B)[X < Y])
else:
  print(A * X + B * Y)