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  :
        if x >= y :
            min_sum = x * 2 * c
        else:
            min_sum = y * 2 * c
    else:
        for i in range(0, x+1):
            for j in range(0, y+1):
                for k in range(0, max(x,j)*2 + 1, 2):
                    if i + k/2 >= x and j + k / 2 >= y:
                        sum = a * i + b * j + k * c
                        if sum < min_sum:
                            min_sum = sum
                        else:
                            break
    print(min_sum)
        # 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

main()
