import math
A,B,C,x,y=map(int,input().split())
price=5000*(10**5)
for a in range(x+1):
    c=(x-a)*2
    b=math.ceil(y-c/2)
    if c<0 or b<0:
        continue
    if A*a+B*b+C*c<price:
        price=A*a+B*b+C*c
print(price)