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

    min_sum = 100000 * 5000 + 100000 * 5000 + 200000 * 5000

    if a == c and b == c :
        min_sum = a * x + b * y
    elif a  < c and b < c  :
        min_sum = a * x + b * y
    elif a  > c and b  > c  :
        if x >= y :
            min_sum = y * 2 * c
            if a > c * 2:
                min_sum = min_sum + (x - y) * c * 2
            else:
                min_sum = min_sum + (x - y ) * a
        else:
            min_sum = x * 2 * c
            if b > c * 2:
                min_sum = min_sum + (y - x) * c * 2
            else:
                min_sum = min_sum + (y - x ) * b
    else:
        for i in range(0, x+1):
            for j in range(0, y+1):
                if min_sum > a * i + b * j + max(x-i, y-j) * c * 2:
                    min_sum =a * i + b * j + max(x-i, y-j) * c * 2

    print(min_sum)
main()
