#pattern1:Only A-pizza/B-pizza
#pattern2:Only C-pizza
#pattern2:C-pizza & A or B-pizza

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

min_price = 1000000000000
for i in range(1, 10**5 + 1):
    price = i*2*c + max(0, x-i)*a + max(0, y-i)*b
    min_price = min(min_price, price)

print(min_price)