#W, H, x, y, r = map(int, input().split())
def main():
    a, b, c, x, y = map(int, input().split())

    sum = 0

    if a  <= c  and b  <= c  :
        sum = a * x + b * y
    elif a  > c   and b  > c  :
        if x >= y :
            sum = x * 2 * c
        else:
            sum = y * 2 * c
    else:
        if a > c and b < c :
            sum = x * c * 2
            if x < y :
                sum = sum + ( y - x ) * b
        else:
            sum = y * c * 2
            if x > y :
                sum = sum + ( x - y ) * a

    print(sum)
main()
