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

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

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:
            break
    
print(total)