A,B,C,X,Y = (int(i) for i in input().split()) 
money = 0


if A+B >= C*2:
    if X+Y % 2 == 0:
        money += (X+Y) * C
    elif X % 2 == 1:
        money += (X+Y-1) *C
        money += 1*A
    else:
        money += (X+Y-1) *C
        money += 1*B
else:
    money += A*X + B * Y

print(money)
