import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools

def main():
    a,b,c,x,y = map(int, input().split())
    if c<=a and c<=b:
        if x > y:
            c_cst = 2*y*c
            x = x -y
            print(a*x+c_cst)
        else:
            c_cst = 2*x*c
            y = y-x
            print(b*y+c_cst)
    elif a<c and b<c:
        print(a*x+b*y)
    elif b < c: # b<c<a
        ans = 0
        c_cst = 2*x*c
        if x >= y:
            ans = c_cst
        else:
            y_2 = y - x
            ans = c_cst+y_2*b
        ans_2 = a*x+b*y
        print(min(ans,ans_2))
    else: # a<c<b
        ans = 0
        c_cst = 2*y*c
        if y >= x:
            ans = c_cst
        else:
            x_2 = x - y
            ans = c_cst+x_2*a
        ans_2 = a*x+b*y
        print(min(ans,ans_2))




if __name__=="__main__":
    main()
