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()))

ans1=a*x+b*y

ans2=2*c*max(x,y)

ans3=2*c*min(x,y)+a*(x-min(x,y))+b*(y-min(x,y))

print((min(ans1,ans2,ans3)))
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()))
ans1 = a * x + b * y
ans2 = 2 * c * max(x, y)
ans3 = 2 * c * min(x, y) + a * (x - min(x, y)) + b * (y - min(x, y))
print((min(ans1, ans2, ans3)))

-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) +ans1 = a * x + b * y +ans2 = 2 * c * max(x, y) +ans3 = 2 * c * min(x, y) + a * (x - min(x, y)) + b * (y - min(x, y)) +print((min(ans1, ans2, ans3)))