import numpy as np

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

DP = np.zeros(((X+1), (Y+1)), dtype=int)

DP[0][0] = 0

def dp(x, y):
    if x < 0 and y < 0:
        return DP[0][y]
    elif x < 0:
        return DP[0][y]
    elif y < 0:
        return DP[x][0]
    else:
        return DP[x][y]

    
for s in range(1, (X + Y + 2)):
    for y in range(0, s+1):
        x = s - y
        if 0 > x or x >= (X+1) or \
           0 > y or y >= (Y+1):
            continue
        pA = dp(x-1, y) + A
        pB = dp(x, y-1) + B
        pC = dp(x-1, y-1) + 2 * C
        if x - 1 < 0:
            pA = 1000000000
        if y - 1 < 0:
            pB = 1000000000
        if x - 1 < 0 and y - 1 < 0:
            pC = 1000000000
        # print('x, y', x, y)
        DP[x][y] = min(min(pA, pB), pC)
        # print('pA, pB, pC = ', pA, pB, pC)
        # print('DP[x][y] = ', DP[x][y])

# print(DP)

# for x in range(X):
#     for y in range(Y):
#         print(x, y, ": ", DP[x][y])
print(DP[X][Y])
