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

first = 2 * max(x,y) + 1
total = 5000 * 10 ** 5 * 2

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