a, b, c, x, y = (int(each) for each in input().split())

cost = [x*a + y*b]
for i in range(max(x, y)*2)+1:
    numofabpizza = i*2
    numofapizza = max(0, (x-numofabpizza))
    numofbpizza = max(0, (y-numofabpizza))
    
    cost.append(numofapizza*a + numofbpizza*b + (2*numofabpizza)*c)
print(min(cost))