a,b,c,x,y=list(map(int,input().split()))

ans=float("inf")

for i in range(2*(max(x,y)+1)):

  p=i*c

  p+=max(x-i//2,0)*a

  p+=max(y-i//2,0)*b

  ans=min(p,ans)

print(ans)
a,b,c,x,y=list(map(int,input().split()))

ans=a*x+b*y

n=max(x,y)

for i in range(1,n+1):

  ans=min(ans,2*i*c+a*max(0,x-i)+b*max(0,y-i))

print(ans)





a, b, c, x, y = list(map(int, input().split()))
ans = float("inf")
for i in range(2 * (max(x, y) + 1)):
    p = i * c
    p += max(x - i // 2, 0) * a
    p += max(y - i // 2, 0) * b
    ans = min(p, ans)
print(ans)

a, b, c, x, y = list(map(int, input().split()))
ans = a * x + b * y
n = max(x, y)
for i in range(1, n + 1):
    ans = min(ans, 2 * i * c + a * max(0, x - i) + b * max(0, y - i))
print(ans)

-ans = float("inf") -for i in range(2 * (max(x, y) + 1)): -    p = i * c -    p += max(x - i // 2, 0) * a -    p += max(y - i // 2, 0) * b -    ans = min(p, ans) +ans = a * x + b * y +n = max(x, y) +for i in range(1, n + 1): +    ans = min(ans, 2 * i * c + a * max(0, x - i) + b * max(0, y - i))