a, b, c, x, y = map(int, input().split())
ans = 0
if c < a and c < b:
  ans += c * max(x, y)*2
elif (c - a < 0 and abs(a-c) < abs(b-c)) or (c - b < 0 and abs(a-c) > abs(b-c)):
  ans += a*x + b* y
else:
  s = max(x, y)
  t = min(x, y)
  ans += c*t*2 + min(a, b)*(s-t)
print(ans)