#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int, X: int, Y: int):
    ans = 0
    if Y > X:
        bigger_y = 1
        bigger_x = 0
    elif Y == X:
        bigger_y = 0
        bigger_x = 0
    else:
        bigger_y = 0
        bigger_x = 1

    if A + B < 2 * C:#C=0
        ans = A*X + B*Y
    else:#C>1
        #Aを2*Cで補うときの利益 > Bを2*Cで補うときの利益
        if A*X - 2*C*X + B*X*bigger_y > B*Y - 2*C*Y + A*Y*bigger_x:
            #A=0
            if bigger_x:
                ans = 2*C*X
            else:
                ans = 2*C*X + (Y-X)*B

        #Aを2*Cで補うときの利益 < Bを2*Cで補うときの利益
        else:
            #B=0
            if bigger_y:
                ans = 2*C*Y
            else:
                ans = 2*C*Y + (X-Y)*A
        if 2*C < A and 2*C < B:
            ans = 2*C*max(X,Y)
    print(ans)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(A, B, C, X, Y)

if __name__ == '__main__':
    main()
