import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

cnt_A = max(X, Y)
cnt_B = max(X, Y)

ans = C * max(X, Y) * 2

for i in range(0, max(X, Y) + 2, 2):
    acc = ans - C * i
    cnt_A -= i // 2
    cnt_B -= i // 2
    if cnt_A < X:
        acc += A * (X - cnt_A)
        cnt_A = X
    if cnt_B < Y:
        acc += B * (Y - cnt_B)
        cnt_B = Y
    ans = min(ans, acc)

print(ans)