from sys import stdin
A,B,C,X,Y = [int(x) for x in stdin.readline().rstrip().split()]
if A + B <= 2*C:
    ans = A*X + B*Y
    
elif A > 2*C and B > 2*C:
    ans = C*2*max(X,Y)

elif A > B:
    ans = 2*C*X + B*max(Y-X,0)

elif B > A:
    ans = A*max(X-Y,0) + 2*C*Y

print(ans)