A, B, C, X, Y = map(int, input().split())

abs_AB = abs(A - B)
abs_AC = abs(A - C)
abs_BC = abs(B - C)

sum_money = 0.0
if A < B and abs_BC - abs_AC > 0:
    a_x = 0
    for y in range(2 * Y):
        sum_money = sum_money + C
        a_x += 0.5
    a_x = int(a_x)
    for x in range(X - a_x):
        sum_money = sum_money + A

elif A > B and abs_AC - abs_BC > 0:
    b_y = 0
    for x in range(2 * X):
        sum_money = sum_money + C
        b_y += 0.5
    b_y = int(b_y)
    for y in range(Y - b_y):
        sum_money = sum_money + B

else:
    for y in range(Y):
        sum_money = sum_money + B
    for x in range(X):
        sum_money = sum_money + A

print(int(sum_money))
