a, b, c, x, y = map(int, input().split())

if max(a, b)<=c:
    print(a*x + b*y)
elif min(a, b)>=c:
    if x==y:
        print(c*2*x)
    elif x>y:
        pizzaToBuy = x- (y)
        if pizzaToBuy*2*c <= a*pizzaToBuy:
            print(c*2*x)
        else:
            print(c*2*y + a*pizzaToBuy)
    else:
        pizzaToBuy = y- (x)
        if pizzaToBuy*2*c <= a*pizzaToBuy:
            print(c*2*y)
        else:
            print(c*2*x + a*pizzaToBuy)
else:
    if 2*c<a+b:
        pizzaToBuy = x- (y)
        if pizzaToBuy>0:
            print(c*2*y + a*pizzaToBuy)
        else:
            print(2*c*y)
    else:
        target1 = max(x-y, 0)
        target2 = max(y-x, 0)
        if a*x + b*y > a*(target1) + c*2*y:
            print(a*(target1) + c*2*y)
        elif a*x + b*y > b*(target2) + c*2*x:
            print(b*(target2) + c*2*x)
        else:
            print(a*x + b*y)