A, B, C, X, Y = map(int, (input().split()))
ans = 0
ab = C * 2
if ab <= A + B:
    buy_c = (min(X, Y) // 2) * 2
    ans += buy_c * ab
    X -= buy_c
    Y -= buy_c

if ab < A:
    buy_c = (X // 2) * 2
    ans += buy_c * ab
    X -= buy_c

if ab < B:
    buy_c = (Y // 2) * 2
    ans += buy_c * ab
    Y -= buy_c

ans += A * X + B * Y

print(ans)
